gnuplot的

编程入门 行业动态 更新时间:2024-10-06 06:42:19
本文介绍了gnuplot的 - 不同长度的水平关键标题排列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

在横放,显然是由于不同的长度在片头我有困难的重点不同标题的对齐方式。

I am having difficulty with the alignment of the different key titles when placed horizontally, apparently due to the differing lengths in the titles.

有两个短畦冠军(第1和第4)和两个较长的冠军(第2和第3),离开最后两个冠军之间有较大的差距(presumably,因为它是设置它们之间的差距由相同的最大字符串长度)。我已经搜查,但没有发现任何办法改变这一点。

Having two short plot titles (1st and 4th) and two longer titles (2nd and 3rd) it leaves a larger gap between the final two titles (presumably as it is setting the gaps between them all by the same maximum string length). I have searched but found no way to alter this.

一个简化的例子如下所示。任何建议或帮助将是很大的AP preciated。

A simplified example is shown below. Any suggestions or help would be greatly appreciated.

set terminal postscript eps size 5.12,2.3 enhanced color "Helvetica" 12 set output 'example.eps' set title 'Difficulty of Long and Short Title usage in Horizontal Keys' font "Helvetica, 20" set key inside bottom center horizontal font "Helvetica, 20" width 1.8 set ylabel 'ylabel' font "Helvetica, 20" set xlabel 'xlabel' font "Helvetica, 20" set lmargin screen 0.10 set rmargin screen 0.95 set yrange [-1.5:1.5] plot sin(x) title 'short', \ cos(x) title 'long title 1', \ -0.5 title 'long title 2', \ 0.5 title 'short' w l ls 4

其结果是:

The result is:

推荐答案

一个可能的解决方法,这将是产生前三个图形,最后一个与两个不同的剧情命令在的multiplot 模式:

One possible workaround for this would be to generate the first three graphs and the last one with two different plot commands in multiplot mode:

set terminal postscript eps size 5.12,2.3 enhanced color "Helvetica" 12 set output 'example.eps' set title 'Difficulty of Long and Short Title usage in Horizontal Keys' font "Helvetica, 20" set ylabel 'ylabel' font "Helvetica, 20" set xlabel 'xlabel' font "Helvetica, 20" set lmargin screen 0.10 set rmargin screen 0.95 set yrange [-1.5:1.5] set bmargin screen 0.15 set tmargin screen 0.9 set multiplot set key horizontal font "Helvetica, 20" width 1.8 at graph 0.4, graph 0.1 center maxrows 1 plot sin(x) title 'short', \ cos(x) title 'long title 1', \ -0.5 title 'long title 2' unset title unset xlabel unset ylabel unset border unset tics set key horizontal font "Helvetica, 20" width 1.8 at graph 0.84, graph 0.1 center maxrows 1 plot 0.5 title 'short' w l ls 4 unset multiplot

不过,这需要一些调整:

However, this requires some tweaking:

  • 第二个剧情您必须删除标题,标签,抽搐和边境之前,否则图形看起来是因为不同的抗混叠锯齿状
  • 要拥有你还必须设置固定相同的利润率 tmargin的和 bmargin
  • 您必须手动地将你的钥匙
  • Before the second plot you must remove title, labels, tics and border, otherwise the graph might look jagged because of different anti-aliasing
  • To have the same margins you must also set fixed tmargin and bmargin
  • You must position your keys manually

以上code给你:

The above code gives you:

现在,你必须判断,如果它的价值。

Now you must judge if its worth.

更多推荐

gnuplot的

本文发布于:2023-11-29 15:35:13,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1646812.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:gnuplot

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!