Gnuplot 5.2 errorlines With Title Ignores Line Settings (windows 终端)
Gnuplot 5.2 errorlines With Title Ignores Line Settings (windows terminal)
我正在尝试在单个 Gnuplot 5.2 绘图上绘制多个 xyerrorline。我发现 xyerrorlines 继承了任何指定标题的行的 errorbar 行属性(linewidth、dashtype)。
我有语法问题吗?
所附的 MWE 绘制了两条简单的线条 - 一条指定了标题,另一条没有指定标题。可以看到没有title的是根据自己的linewidth和dashtype显示的,而有title的好像继承了"set errorbars"行(第2行)的linewidth和dashtype。
set terminal windows color enhanced "Ariel" 8 close
set errorbars 5 linewidth 2 dashtype 1
set xrange[0:5]
set yrange[0:20]
set xlabel "X Values"
set ylabel "Y Values"
plot '-' with xyerrorlines linecolor rgbcolor "#B2B2B2" pointtype 2 pointsize 4 linewidth 4 dashtype 3 title 'Method 1',\
'-' with xyerrorlines linecolor rgbcolor "#000000" pointtype 2 pointsize 2 linewidth 4 dashtype 4 notitle
1 1 0.1 0.5
2 4 0.1 0.5
3 9 0.1 0.5
4 16 0.1 0.5
e
1 2 0.1 0.5
2 6 0.1 0.5
3 11 0.1 0.5
4 18 0.1 0.5
e
结果如下图:
删除行:
set errorbars 5 linewidth 2 dashtype 1
为带有标题的每一行启用独立的线宽和虚线类型设置,但错误栏继承了我不想要的这些属性。我想为错误栏和线条设置单独的线条和破折号样式(如手册第 128 页所暗示的那样)
此行为也出现在 postscript 终端中。我没有测试过任何其他终端。
我正在使用 Gnuplot 版本 5.2 补丁级别 7。
谢谢,
-瑞安
错误似乎是由 non-blank 标题和情节样式 xyerrorlines 的组合触发的。我认为错误栏属性的设置本身不会影响这一点。我将调查该错误的根本原因,但同时这里有一个 work-around:
$D1 << EOD
1 1 0.1 0.5
2 4 0.1 0.5
3 9 0.1 0.5
4 16 0.1 0.5
EOD
$D2 << EOD
1 2 0.1 0.5
2 6 0.1 0.5
3 11 0.1 0.5
4 18 0.1 0.5
EOD
set errorbars 5 linewidth 2 dashtype 1
plot $D1 with xyerrorlines lc rgbcolor "#B2B2B2" pt 2 ps 4 lw 4 dt 3 notitle,\
$D2 with xyerrorlines lc rgbcolor "#000000" pt 2 ps 2 lw 4 dt 4 notitle, \
keyentry with xyerrorlines lc rgbcolor "#B2B2B2" pt 2 ps 4 lw 4 dt 3 title "Method 1",\
keyentry with xyerrorlines lc rgbcolor "#000000" pt 2 ps 2 lw 4 dt 4 title "Method 2"
诀窍是首先绘制没有标题的所需数据以避免错误,然后使用标题但没有数据创建相应的键条目。 "keyentry" plot 组件相对较新,但它存在于版本 5.2.7 中。
我正在尝试在单个 Gnuplot 5.2 绘图上绘制多个 xyerrorline。我发现 xyerrorlines 继承了任何指定标题的行的 errorbar 行属性(linewidth、dashtype)。
我有语法问题吗?
所附的 MWE 绘制了两条简单的线条 - 一条指定了标题,另一条没有指定标题。可以看到没有title的是根据自己的linewidth和dashtype显示的,而有title的好像继承了"set errorbars"行(第2行)的linewidth和dashtype。
set terminal windows color enhanced "Ariel" 8 close
set errorbars 5 linewidth 2 dashtype 1
set xrange[0:5]
set yrange[0:20]
set xlabel "X Values"
set ylabel "Y Values"
plot '-' with xyerrorlines linecolor rgbcolor "#B2B2B2" pointtype 2 pointsize 4 linewidth 4 dashtype 3 title 'Method 1',\
'-' with xyerrorlines linecolor rgbcolor "#000000" pointtype 2 pointsize 2 linewidth 4 dashtype 4 notitle
1 1 0.1 0.5
2 4 0.1 0.5
3 9 0.1 0.5
4 16 0.1 0.5
e
1 2 0.1 0.5
2 6 0.1 0.5
3 11 0.1 0.5
4 18 0.1 0.5
e
结果如下图:
删除行:
set errorbars 5 linewidth 2 dashtype 1
为带有标题的每一行启用独立的线宽和虚线类型设置,但错误栏继承了我不想要的这些属性。我想为错误栏和线条设置单独的线条和破折号样式(如手册第 128 页所暗示的那样)
此行为也出现在 postscript 终端中。我没有测试过任何其他终端。
我正在使用 Gnuplot 版本 5.2 补丁级别 7。
谢谢, -瑞安
错误似乎是由 non-blank 标题和情节样式 xyerrorlines 的组合触发的。我认为错误栏属性的设置本身不会影响这一点。我将调查该错误的根本原因,但同时这里有一个 work-around:
$D1 << EOD
1 1 0.1 0.5
2 4 0.1 0.5
3 9 0.1 0.5
4 16 0.1 0.5
EOD
$D2 << EOD
1 2 0.1 0.5
2 6 0.1 0.5
3 11 0.1 0.5
4 18 0.1 0.5
EOD
set errorbars 5 linewidth 2 dashtype 1
plot $D1 with xyerrorlines lc rgbcolor "#B2B2B2" pt 2 ps 4 lw 4 dt 3 notitle,\
$D2 with xyerrorlines lc rgbcolor "#000000" pt 2 ps 2 lw 4 dt 4 notitle, \
keyentry with xyerrorlines lc rgbcolor "#B2B2B2" pt 2 ps 4 lw 4 dt 3 title "Method 1",\
keyentry with xyerrorlines lc rgbcolor "#000000" pt 2 ps 2 lw 4 dt 4 title "Method 2"
诀窍是首先绘制没有标题的所需数据以避免错误,然后使用标题但没有数据创建相应的键条目。 "keyentry" plot 组件相对较新,但它存在于版本 5.2.7 中。