[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: contour AND plot(,,'o')

From: Ian MacPhedran
Subject: Re: contour AND plot(,,'o')
Date: Tue, 23 Mar 1999 18:47:15 -0600 (CST)

On Tue, 23 Mar 1999, John W. Eaton wrote:

> On 23-Mar-1999, Daniel Heiserer <address@hidden> wrote:
> | How can I make a contour plot, hold it and the do a 'o' line plot?
> | 
> | The following doesn't work. All I tried returned crap.
> You want to superimpose a 2d plot and a contour plot, right?
> Unfortunately, I don't think gnuplot can do this.  I think the reason
> is that gnuplot does contouring as a special case of 3d plotting, and
> there is no way to get gnuplot to do 2d and 3d plotting at the same
> time.  Please correct me if I'm wrong, or ask the gnuplot people if it
> is correct, or if there will ever be a way to do what you want.

That is correct, but gnuplot can be tricked :-) I'm not sure if this can
be done from the octave side, though.

The trick is to use parametric graphs. I've deleted the original query
(sorry), but this should show the way. I'm not sure how closely it meets
your needs.

In gnuplot:
set cont surf
set view 0,0,1.5
set nokey
set param
set urange [-3:3]
set vrange [-3:3]
set isosam 20
splot u,v,sin(u)*cos(v) lt 0, u,sin(u),2 lt -1
      ^^^^^^^^^^^^^^^^^       ^^^^^^^^^^^^^^^^
Three dimensional function | Two dimensional function to be
to be contoured            | overlaid (line type added for contrast)

This should work in both gnuplot 3.5 and 3.7.

Ian MacPhedran,    Engineering Computer Centre,   2B13 Engineering Building,
University of Saskatchewan,  57 Campus Drive,  Saskatoon SK  S7N 5A9, CANADA
Phone: (306)966-4832 Fax: (306)966-5205  Email: address@hidden

reply via email to

[Prev in Thread] Current Thread [Next in Thread]