gnuplot图例重叠图形 [英] gnuplot legend overlaps graph

查看:406
本文介绍了gnuplot图例重叠图形的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我遇到的问题是图例重叠了我试图绘制的gnuplot图形,如下图所示。





以下是我用来绘制数据。

 >设置日志y 
>使用带有行的2:4,使用带有行的2:4,使用2:6带有行的
datafile1.txt,绘制datafile1.txt$ b $datafile2.txt datafile2.txt使用2:6与行

以下是数据文件的一部分1我是

 尺寸:259计时:36111秒,9秒
尺寸:260计时:37860秒,9秒
尺寸:261计时:39477秒,6秒
尺寸:262计时:41215秒,5秒
尺寸:263计时:41827秒,5秒
尺寸:264计时:42738秒11秒
尺寸:265计时:42972秒,14秒
尺寸:266计时:44138秒,10秒
尺寸:267计时:45210秒, 11秒
尺寸:268计时:46508秒,9秒
尺寸:269计时:51120秒,15秒
尺寸:270计时:49352秒,6秒
尺寸: 271时机:50 456秒,9秒
尺寸:272计时:52379秒,16秒
尺寸:273计时:52354秒,16秒

以下是我用于绘制数据的数据文件2的一部分。

 尺寸:269计时:32507秒,2秒
尺寸:270计时:33064秒,4秒
尺寸:271计时:33590秒,6秒
尺寸:272计时: 33703秒,3秒
尺寸:273计时:34616秒,3秒
尺寸:274计时:36113秒,4秒
尺寸:275计时:36477秒,4秒
尺寸:276计时:37000秒,2秒
尺寸:277计时:37872秒,3秒
尺寸:278计时:42290秒,6秒
尺寸:279计时:39862秒,7秒
尺寸:280正时:40184秒,7秒
尺寸:281正时:41229秒,4秒
尺寸:282 T iming:43221秒,3秒
尺寸:283计时:42706秒,7秒

任何帮助或建议如何克服这一点,将不胜感激。

解决方案

如果您想完全关闭它:

  gnuplot> set nokey 

如果您想移动图例,可以使用

  gnuplot>将设置键左上方

移动到左上角。如果您想在图例中给出更多有意义的名称,请在生成图时使用标题关键字:

  gnuplot的>使用2:4的线条标题data绘制datafile1.txt,
....


Essentially, the problem that I am experiencing is that the legend overlaps the gnuplot graph that I am trying to plot as illustrated in the following diagram.

Following is the command that I am using to plot the data.

> set log y
> plot "datafile1.txt" using 2:4 with lines,
  "datafile1.txt" using 2:6 with lines,
  "datafile2.txt" using 2:4 with lines,
  "datafile2.txt" using 2:6 with lines

Following is a portion of the data file 1 I am using to plot the data.

Dimension:  259 Timing: 36111 seconds,  9 seconds
Dimension:  260 Timing: 37860 seconds,  9 seconds
Dimension:  261 Timing: 39477 seconds,  6 seconds
Dimension:  262 Timing: 41215 seconds,  5 seconds
Dimension:  263 Timing: 41827 seconds,  5 seconds
Dimension:  264 Timing: 42738 seconds,  11 seconds
Dimension:  265 Timing: 42972 seconds,  14 seconds
Dimension:  266 Timing: 44138 seconds,  10 seconds
Dimension:  267 Timing: 45210 seconds,  11 seconds
Dimension:  268 Timing: 46508 seconds,  9 seconds
Dimension:  269 Timing: 51120 seconds,  15 seconds
Dimension:  270 Timing: 49352 seconds,  6 seconds
Dimension:  271 Timing: 50456 seconds,  9 seconds
Dimension:  272 Timing: 52379 seconds,  16 seconds
Dimension:  273 Timing: 52354 seconds,  16 seconds

Following is a portion of the data file 2 I am using to plot the data.

Dimension:  269 Timing: 32507 seconds,  2 seconds
Dimension:  270 Timing: 33064 seconds,  4 seconds
Dimension:  271 Timing: 33590 seconds,  6 seconds
Dimension:  272 Timing: 33703 seconds,  3 seconds
Dimension:  273 Timing: 34616 seconds,  3 seconds
Dimension:  274 Timing: 36113 seconds,  4 seconds
Dimension:  275 Timing: 36477 seconds,  4 seconds
Dimension:  276 Timing: 37000 seconds,  2 seconds
Dimension:  277 Timing: 37872 seconds,  3 seconds
Dimension:  278 Timing: 42290 seconds,  6 seconds
Dimension:  279 Timing: 39862 seconds,  7 seconds
Dimension:  280 Timing: 40184 seconds,  7 seconds
Dimension:  281 Timing: 41229 seconds,  4 seconds
Dimension:  282 Timing: 43221 seconds,  3 seconds
Dimension:  283 Timing: 42706 seconds,  7 seconds

Any help or advice on how to overcome this would be appreciated.

解决方案

If you want to turn it off altogether:

gnuplot> set nokey

If you want to move the legend, you can do this with

gnuplot> set key left top

to move it to the top left. If you want to give the lines more meaningful names in the legend, use the title keyword when generating the plot:

gnuplot> plot "datafile1.txt" using 2:4 with lines title "data",
....

这篇关于gnuplot图例重叠图形的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆