MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

RE: Re: Re: level curve selection

  • To: mathgroup at
  • Subject: [mg66519] RE: [mg66475] Re: [mg66460] Re: level curve selection
  • From: "David Park" <djmp at>
  • Date: Wed, 17 May 2006 03:31:02 -0400 (EDT)
  • Sender: owner-wri-mathgroup at


Yes, the problem is that with contour shading the second plot will overlay
and hide the first plot. However, if you want to simply add contour lines in
the second plot, without additional shading you could do it as follows with


Module[{contours1, contours2},
   contours1 = ContourDraw[Cos[2*x + y]*Cos[y - x],
      {x, -Pi/2, Pi/2}, {y, -Pi/2, Pi/2}, PlotPoints -> 50,
      Contours -> 7, ContourShading -> True];
    contours2 = ContourDraw[Cos[2*x + y]*Cos[y - x],
      {x, -Pi/2, Pi/2}, {y, -Pi/2, Pi/2}, PlotPoints -> 50,
      Contours -> {0.9, 0.95, 0.99}, ContourShading ->
       False, ContourStyle -> Red];
    Draw2D[{contours1, contours2},
      AspectRatio -> Automatic,
     ImageSize -> 450]];

But in general, if you really want to control the contours, the best thing
is to list them specifically. You can always use Join with Range and
specific lists. If you use Automatic along with additional contours, and you
don't really know what Automatic is going to give you, then very often you
would not obtain a very good set of contours anyway.

David Park
djmp at

From: Chris Chiasson [mailto:chris at]
To: mathgroup at


Did you try that? (Mathematica colors the background of the second
plot white, so showing them both overwrites the contours of the first
plot with white. It is still an interesting approach. I am sure the
relevant graphics directives could be reaped out of the second plot.
The main difficulty with this approach would be that the contour
shading might be off (ie, some inner rings might be lighter than some
outer rings). I wonder if that could be circumvented by extracting the
PlotRange from the AbsoluteOptions of the first graph and setting that
as an option for the second. I will look at this approach some more.

Thank you Mr. Rowe.

On 5/14/06, Bill Rowe <readnewsciv at> wrote:
> On 5/13/06 at 2:42 AM, chris at (Chris Chiasson) wrote:
> >Does anyone know of good algorithms that can select contours to plot
> >while also accepting user specifed contours?
> >Something like:
> >ContourPlot[yaddayadda,Contours->AutomaticButIncludeThese[{5,10,15}]
> >]
> One way to accomplish this would be as follows:
> Show[
>   Block[{$DisplayFunction=Indentity},
>   {ContourPlot[yaddayadda,Contours->Automatic],
>   ContourPlot[yaddayadda,Contours->A{5,10,15}]}]];
> --
> To reply via email subtract one hundred and four


  • Prev by Date: Re: Reconstructing data points from a InterpolatingFunction object
  • Next by Date: Re: compound symmetrical primes
  • Previous by thread: Re: Re: level curve selection
  • Next by thread: Re: level curve selection