From: JMvanwessem van Wesesm on
I have a question. I want to make two contourplots in one graph. I have 2 functions that depend on 2 variables and I want to plot these together, one as a filled contourplot(contourf) and one as a line contourplot.

I can't seem to do this in matlab since it uses the same range for both functions, while I want to plot them seperately, as if I where displaying the two contourplots on top of each other. An example that hopefully explains my wishes is the plot on this page: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90

How can I effectively do this in matlab? Thanks in advance!

Greetings.
From: John D'Errico on
"JMvanwessem van Wesesm" <jmvanwessem(a)gmail.com> wrote in message <hn5p2t$ao9$1(a)fred.mathworks.com>...
> I have a question. I want to make two contourplots in one graph. I have 2 functions that depend on 2 variables and I want to plot these together, one as a filled contourplot(contourf) and one as a line contourplot.
>
> I can't seem to do this in matlab since it uses the same range for both functions, while I want to plot them seperately, as if I where displaying the two contourplots on top of each other. An example that hopefully explains my wishes is the plot on this page: http://addictedtor.free.fr/graphiques/RGraphGallery.php?graph=90
>
> How can I effectively do this in matlab? Thanks in advance!

Just use

hold on

To allow you to plot both functions on one set of axes.

John
From: JMvanwessem van Wesesm on
Well, that doesn't work. It plots in 1 graph of course, but it uses the range of 1 function and not of both function seperately. I just want the first function to be defined by the colorbar, and the other with contour-labels. Seperately setting the Z-range for both functions doesnt work, it overwrites eachother.
From: Walter Roberson on
JMvanwessem van Wesesm wrote:
> Well, that doesn't work. It plots in 1 graph of course, but it uses the
> range of 1 function and not of both function seperately. I just want the
> first function to be defined by the colorbar, and the other with
> contour-labels. Seperately setting the Z-range for both functions doesnt
> work, it overwrites eachother.

Then you will have to position two axis in the same place and draw separately
to them. Set the Color property of the top axis to be 'none' so that the
underneath shows through.
From: TideMan on
On Mar 10, 10:47 am, "JMvanwessem van Wesesm" <jmvanwes...(a)gmail.com>
wrote:
> Well, that doesn't work. It plots in 1 graph of course, but it uses the range of 1 function and not of both function seperately. I just want the first function to be defined by the colorbar, and the other with contour-labels. Seperately setting the Z-range for both functions doesnt work, it overwrites eachother.

Look, I do this all the time with tides. It's called a "cotidal
chart".
I use contourf for the amplitude, then hold on, and contourc for the
phase lines.
Amplitudes go from zero to 1 or 2 and phases go from 0 to 360 (there
is a problem when it goes from 360 back to zero, but that happens with
any contouring program).
So, you must be doing something wrong.
Post your code so that we can see what it is.