绘制(轮廓图,视图图)并在同一图形上绘制
问题描述:
我正在尝试绘制两个叠加图.
I am trying to plot two overlaying graphs.
第一个是简单的x-y点图:
The first is a simple x-y points plot:
plot myfile u 1:2
第二个是0级的等高线图,我可以用 以下命令:
The second is a contour plot at level 0, which I can plot with the following commands:
set contour
unset surface
set view map
set cntrparam levels discrete 0
splot a0 + a1*x + a2*y + a3*x**2 + a4*x*y + a5*y**2 + a6*x**3 + a7*x**2*y + a8*x*y**2 + a9*y**3
a0
-a9
是常量
两者都使用相同的xrange和yrange.
Both use the same xrange and yrange.
如何将它们都绘制在同一张图中?
How can I plot them both in the same graph?
答
这有些棘手.您可以使用
This is a somewhat tricky one. You can write the contours to a file using
未经测试的
set table 'datafile'
set contour
#contour options
splot ... with contours
unset table
然后您可以用线绘制该数据:
Then you can plot that data with lines:
set term ...
set output ...
set view map
splot myfile u 1:2:(0.0), 'datafile' u 1:2:3 w lines