Gnuplot 图例 errorbar 符号垂直
Gnuplot legend errorbar symbol vertical
如何使用 gnuplot 使图例错误符号垂直而不是水平? set key vertical
没有给出想要的结果:
set key vertical
plot "file.txt" using 1:2:3 with yerrorbars
感谢 by Christoph 的想法。
如Christoph in comments on the question, there is no built-in way to change the orientation of the errorbars in the legend: xerrorbars, yerrorbars and xyerrorbars所示,都是水平的。
要获得垂直误差线,可以考虑禁用图例 (unset key
) 并使用 set label
和 set arrow
手动绘制。即可以将误差条绘制为带有两个头的箭头,形状为垂直于箭头线的线。这可能看起来像:
# definition of arrow styles and line styles here, something like:
# set style line 41 lc rgb "#cccccc" lt 1 lw 1 ps 0.5 pt 6
# set style arrow 1 heads size screen 0.008,90 ls 1
# ...
set label "class 1" at graph 0.7, graph 1 # label
set arrow as 1 from graph 1, graph 0.97 to graph 1, graph 1.02 # arrow
set label "" at graph 1, graph 0.99 point ls 1 # dot
set label "class 2" at graph 0.7, graph 0.8 # label
set arrow as 2 from graph 1, graph 0.77 to graph 1, graph 0.82 # arrow
set label "" at graph 1, graph 0.79 point ls 2 # dot
您当然可以调整条形的长度、它们的位置、点的大小、垂直线的长度,...
如何使用 gnuplot 使图例错误符号垂直而不是水平? set key vertical
没有给出想要的结果:
set key vertical
plot "file.txt" using 1:2:3 with yerrorbars
感谢
如Christoph in comments on the question, there is no built-in way to change the orientation of the errorbars in the legend: xerrorbars, yerrorbars and xyerrorbars所示,都是水平的。
要获得垂直误差线,可以考虑禁用图例 (unset key
) 并使用 set label
和 set arrow
手动绘制。即可以将误差条绘制为带有两个头的箭头,形状为垂直于箭头线的线。这可能看起来像:
# definition of arrow styles and line styles here, something like:
# set style line 41 lc rgb "#cccccc" lt 1 lw 1 ps 0.5 pt 6
# set style arrow 1 heads size screen 0.008,90 ls 1
# ...
set label "class 1" at graph 0.7, graph 1 # label
set arrow as 1 from graph 1, graph 0.97 to graph 1, graph 1.02 # arrow
set label "" at graph 1, graph 0.99 point ls 1 # dot
set label "class 2" at graph 0.7, graph 0.8 # label
set arrow as 2 from graph 1, graph 0.77 to graph 1, graph 0.82 # arrow
set label "" at graph 1, graph 0.79 point ls 2 # dot
您当然可以调整条形的长度、它们的位置、点的大小、垂直线的长度,...