我在 Gnuplot 中有一个极坐标图,由
给出set polar
set angles degrees
unset xtics
unset ytics
unset raxis
set ttics 0,30
set grid polar linestyle 1 dashtype 2 linecolor rgb 'grey'
set samples 200, 200
unset border
set xrange [-0.51:0.51]
set yrange [-0.51:0.51]
set size square
unset key
plot sin(2*t)*cos(2*t)
输出如下:
但是,
- 我希望 rlabel(0、0.1、0.2 等)呈 45 度角,而不是放置在 x 轴上,并且
- 不应该有任何问题
任何帮助将不胜感激。
最佳答案
为了删除rtics
,请设置rtics比例0
。
您可以设置极坐标图的起始角度(请查看 help theta
),但是只能设置为 {right|top|left|bottom}
而不是 45° ,但这仍然对你没有帮助。
因此,您可能必须“手动”设置标签。也许有一种我不知道的自动方式。检查以下示例。
代码:
### set rtics on 45° "axis"
reset session
set polar
set angles degrees
unset xtics
unset ytics
unset raxis
set ttics 0,30
set grid polar linestyle 1 dashtype 2 linecolor rgb 'grey'
set samples 200, 200
unset border
set xrange [-0.51:0.51]
set yrange [-0.51:0.51]
set size square
unset key
set rtics scale 0
set format r ""
myRTics = "0.1 0.2 0.3 0.4 0.5"
do for [i=1:words(myRTics)] {
r = word(myRTics,i)
set label i sprintf("%s",r) at r*cos(45),r*sin(45) center
}
plot sin(2*t)*cos(2*t)
### end of code
结果:
关于gnuplot - 将 gnuplot 轴标签旋转到 45 度,无需 rtics,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/69331992/