如何在gnuplot的3D绘图中旋转刻度标签?
在gnuplot 3D绘图中旋转刻度标签的方法问询
在3D绘图中旋转刻度标签十分必要,尤其是当文本刻度标签较多时,旋转可避免重叠并提升辨识度,而2D绘图中实现该操作并无问题。
脚本(需gnuplot 5.4.0版本,因使用set boxdepth)
### how to rotate xticlabels in 3D? reset session $Data <<EOD Alpha One 1.00 Alpha Two 2.00 Alpha Three 3.00 Alpha Four 4.00 Beta One 1.25 Beta Two 2.25 Beta Three 3.25 Beta Four 4.25 Gamma One 1.50 Gamma Two 2.50 Gamma Three 3.50 Gamma Four 4.50 Delta One 1.75 Delta Two 2.75 Delta Three 3.75 Delta Four 4.75 EOD set xrange [-0.5:3.5] set yrange [-0.5:3.5] set grid x,y set key noautotitle set multiplot layout 1,2 set size square set xlabel "x axis label" set xtic rotate by 45 right set ylabel "y axis label" set ytic rotate by 45 right plot $Data u (int($0)/4):(int($0)%4):3:xtic(1):ytic(2) w p pt 5 ps 5 lc palette set view 60,30 set xlabel rotate parallel offset 0,0,0 set xtic rotate by 45 right # apparently doesn't have any effect in 3D set ylabel rotate parallel offset 0,0,0 set ytic rotate by -45 left # apparently doesn't have any effect in 3D set xyplane at 0 set boxwidth 0.5 set boxdepth 0.5 splot $Data u (int($0)/4):(int($0)%4):3:xtic(1):ytic(2) w boxes lc palette z unset multiplot ### end of script
结果(wxt终端)

实际测试发现,仅2D绘图可旋转刻度标签,3D模式下无法实现,help tics中并未明确说明该限制。
rotate asks gnuplot to rotate the text through 90 degrees, which will
be done if the terminal driver in use supports text rotation. norotate
cancels this. rotate byasks for rotation by degrees,
supported by some terminal types.
显然wxt终端支持文本旋转,但仅局限于2D模式。
- 此前关于轴标签旋转的问题,可通过
rotate parallel实现,但无法设置任意角度,且不适用于刻度标签。 - 另有关于将轴标签投影至xy平面的问题,目前仅能通过复杂的变通方法实现。
现正式问询:如何在gnuplot的splot3D绘图中旋转数值或文本刻度标签?
内容的提问来源于stack exchange,提问作者theozh
相关产品推荐
相关产品推荐

