重新排列fillcurved的地块标题

托比

我有一个不错的gnuplot图形,我想在其中更改键中的标签。我遇到的问题与filledcurves选项有关。为了使事情变得容易,我附加了图像。可以看到,关键标签是2-1-3,而我希望在保留相同的fillcurves模式的情况下具有1-2-3。当然,只需更改情节的顺序,就会给我1-2-3,但是填充的方式也会分别发生变化,我想避免这种情况。我试图通过使用NaNgnuplot(https://stackoverflow.com/questions/10614654/gnuplot-legend-order)中可能性以某种方式破解它,但是这里的问题是填充方式不同。在检查gnuplot文档时(http://www.bersch.net/gnuplot-doc/filledcurves.html)我意识到没有固定模式的选项,但我想应该有某种方法。为了进行测试,我附加了gnuplot脚本。

在此处输入图片说明

#!/bin/gnuplot
#------------------------------------------------------------------------------

set grid
set key right top
set xrange [20:220]

set style line 20 lw 2 lc rgb 'black'
set border linestyle 20
set style line 1 lw 2.0 lc rgb 'dark-gray'
set style line 2 lw 2.0 lc rgb '#202020'
set style line 3 lw 2.0 lc rgb 'gray'
set style fill transparent pattern 2


#------------------------------------------------------------------------------
A=-1.74959e-14
B=-1.87199e-12
C=1.87756e-9
DeltaBDP=0.45e-9

OffsetBP=0.05e-9
DeltaBP=0.8e-9

OffsetB=0.7e-9
DeltaB=0.8e-9

# 
f(x)=A*x**2+B*x+C
g(x)=f(x)+DeltaBDP

# Beta P
h(x)=f(x)+OffsetBP
i(x)=h(x)+DeltaBP

# Beta
j(x)=h(x)+OffsetB
k(x)=j(x)+DeltaB

#------------------------------------------------------------------------------

set terminal epslatex
set output 'tex/foobar.tex'
plot \
'+' using 1:(j($1)*1e9):(k($1)*1e9) with filledcurves closed lc rgb 'dark-gray' t '2' , \
'+' using 1:(f($1)*1e9):(g($1)*1e9) with filledcurves closed lc rgb 'dark-gray' t '1', \
'+' using 1:(h($1)*1e9):(i($1)*1e9) with filledcurves closed lc rgb '#202020' t '3', \
f(x)*1e9 w l ls 1 t '', \
g(x)*1e9 w l ls 1 t '', \
h(x)*1e9 w l ls 2 t '', \
i(x)*1e9 w l ls 2 t '', \
j(x)*1e9 w l ls 3 t '', \
k(x)*1e9 w l ls 3 t ''


#------------------------------------------------------------------------------
托比

如果有人遇到相同的问题,则解决方案很简单(一如既往)。搜索关键字后pattern style fill,很明显如何处理它。首先,就像我已经做过的一样,@ ksyrium还提到要取消剧情中的标题。随后,NaN在使用选择图案的同时添加绘图fill pattern <int>这样一来,NaN就可以根据需要更改绘图中的顺序

plot \
'+' using 1:(j($1)*1e9):(k($1)*1e9) with filledcurves closed lc rgb 'dark-gray' t '1real', \
'+' using 1:(f($1)*1e9):(g($1)*1e9) with filledcurves closed lc rgb 'dark-gray' t '2real', \
'+' using 1:(h($1)*1e9):(i($1)*1e9) with filledcurves closed lc rgb '#202020' t '3real', \
f(x)*1e9 w l ls 1 t '', \
g(x)*1e9 w l ls 1 t '', \
h(x)*1e9 w l ls 2 t '', \
i(x)*1e9 w l ls 2 t '', \
j(x)*1e9 w l ls 3 t '', \
k(x)*1e9 w l ls 3 t '', \
NaN with filledcurves closed fill pattern 2 lc rgb 'dark-gray' t '1', \
NaN with filledcurves closed fill pattern 3 lc rgb 'dark-gray' t '2', \
NaN with filledcurves closed fill pattern 4 lc rgb '#202020' t '3'

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章