2012-02-24 103 views
7

我是gnuplot的新手,在绘制堆积直方图时,发现图例隐藏在数据后面。gnuplot:图例隐藏在数据后面

有没有一种方法可以将图例置于数据之上?非常感谢你的帮助。 编辑:我目前正在使用设置密钥外底部放置传说外,但这不是我想要的最佳解决方案。

回答

3

最新版本允许使传奇的白色背景:

set key opaque 

这只是增加了一个白色背景,传说中那么它出现在所有图的顶部。在this Post找到答案。

3

如果你宁愿对数据,而不是情节箱共外键上方的按键,这里是一个解决方法(使用罪(10 * X)为例):

set multiplot 
unset key 
plot sin(10*x) # this will plot with tics and a border, but no key 
set key box 
unset tics 
unset border 
bignumber=10 # make this number larger than the y range so the line will not be seen 
plot [][0:1] bignumber title 'sin(10*x)' # this will just plot the key with the title 
unset multiplot 

使用这种方法,首先绘制数据/函数,然后在刚刚有一个键的顶部创建一个绘图。您必须确保正确设置第二个标题的标题。

+1

感谢您的解决方案,但不是更多的解决方法? Gnuplot以某种方式必须允许在没有多槽技巧的情况下在所有数据之上绘制图例,对吧?我认为这不是一个很少的情况或特殊的功能,...仍然在寻找更好的东西... – 2013-08-26 11:57:08

+0

现在,我已经学会了更老,更聪明,我已经学会了'set key opaque'命令,它在绘制所有数据后绘制关键字! – andyras 2013-08-26 19:17:07