gnu使用多图同时绘制等高线图和曲线



我正在尝试使用多图在等值线图上叠加曲线,这是我的 gnuplot 脚本。

set term postscript enhanced color 'Times-Roman,24'
set output 'cimax_pmf.eps'
set encoding iso_8859_1
set nokey
set xlabel 'RC(305)'
set xrange [0:12]
set yrange [0.2:1]
set ylabel 'c^2_{imax}'
set y2label 'PMF (kcal/mol)'
set y2range [-20:1]
set multiplot
set pm3d map interpolate 10,10
set view map
set isosamples 10  #increase resolution
set palette rgb 33,13,10   #rainbow color scheme
unset colorbox
splot[0:12][0.2:1] 'cisq_rrr_reduced.dat' u 1:2:3  notitle
unset map
plot[0:12] 'final_pmf.dat' u 1:2 w line lt 2 lw 2 notitle axis x1y2
unset multiplot

值得一提的是,我有两个垂直 y 轴,正如脚本中的"axis x1y2"所建议的那样。问题是运行这个脚本后,我发现第二个图与第一个图没有正确对齐。换句话说,它们具有不同的大小,并且它们的重叠似乎是有问题的。它看起来像本页第一个图中描述的问题http://lowrank.net/gnuplot/plot3-e.html#5.10

但是我无法使用类似于该页面的脚本来解决此问题。

谢谢。

我更熟悉彼此相邻或相邻的多个情节,但有两件事可能会对您有所帮助:

  • 多图允许对每个图形使用"设置大小"命令(有关详细信息,请参阅"帮助设置大小")。但我想如果你说 Not So FAQ 页面上的脚本没有帮助,这可能还不够。
  • 因此,设置边距
  • (请参阅"帮助设置边距")可能很有用,这可用于在多图中更精确地对齐图形。它还经常解决导致许多错位问题的不同长度的数据范围的问题。

我建议根本不使用pm3dmultiplot,而是使用plot … with image。这样,您可以使用单个plot命令来完成。

如果我没有犯任何错误,只需将您的代码更改为(multiplot之前的所有内容都保持不变):

[…]
set y2range [-20:1]
set palette rgb 33,13,10   #rainbow color scheme
unset colorbox
plot
'cisq_rrr_reduced.dat' w image notitle,
'final_pmf.dat' u 1:2 w line lt 2 lw 2 notitle axis x1y2
您可以使用

gnuplot 的功能,通过 set table 将轮廓数据保存到文件中(请参阅文档,以及此处的隐式示例)。像这样:

...
set table 'contours.dat'
splot[0:12][0.2:1] 'cisq_rrr_reduced.dat' u 1:2:3  notitle
unset table
plot[0:12] 'final_pmf.dat' u 1:2 w line lt 2 lw 2 notitle axis x1y2, 
           'contours.dat' using 1:2

根据您的情况进行调整。

最新更新