plotting a 2D line on top of a contour plot

plotting a 2D line on top of a contour plot

Post by michiel gu » Tue, 18 Aug 2009 23:23:00


I like to plot a line say f(x)=10*x on top of a contour plot

unset surface
set view 0,0
splot x**2+y**2

how can I do that?

Michiel
 
 
 

plotting a 2D line on top of a contour plot

Post by Zolta » Wed, 19 Aug 2009 05:10:11


I am not sure of whether I have understood you correctly, but if you
want to plot a straight line (or any function) on a colour-coded plot
(by the way, what you show doesn't give you a contour plot), then I
would do the following

set table 'test.dat'
splot x*x+y*y
unset table
p 'test.dat' with image, 10*x w l

Since you set the view to 0,0, it's better to use plot with image, for
which you need the data file 'test.dat'.