Don't be fooled by the fact that there are only three lines on the x-z plane: since our function was symmetric in y with respect to, some contour lines will overlap. If we set the contour beforehand, we will see the contours on the bottom.Īnd here is the figure that we have just produced. At the end, we plot the data file as surface. In order to make the contours more visible, we have to specify an xrange and yrange which is a bit bigger, than our actual data set. In this way, we "project" those columns onto the y-z and x-z planes. This is really simple: We plot the contours by plotting 'out.dat', and 'out2.dat' column by column, and keeping the first and second coordinates constant. Instead of actually rotating the date file, I simply interchanged the variables, and printed out the file for a second time, for I was a bit lazy.
These were produced in octave by the functionį(x,y) = sin(y/4)*cos(x/4)+exp(-x*x - y*y/3) I will only post a skeleton here, you can dress up the graph at your will.įor a start, here is our data file, which we will call 'out.dat'
As I pointed out in my reply, it is rather easy, if we can rotate the data file by 90 degrees. Karl asked a question some time ago, in which he wanted to know how one can produce this graph.