Home > Archive > Mathematica > May 2006 > level curve selection
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
level curve selection
|
|
| Chris Chiasson 2006-05-13, 4:09 am |
| 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}]]
??
--
http://chris.chiasson.name/
| |
| Bill Rowe 2006-05-14, 4:11 am |
| On 5/13/06 at 2:42 AM, chris@chiasson.name (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
| |
| Chris Chiasson 2006-05-15, 10:05 pm |
| Heheh,
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@earthlink.net> wrote:
> On 5/13/06 at 2:42 AM, chris@chiasson.name (Chris Chiasson) wrote:
>
>
>
>
> 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
>
>
--
http://chris.chiasson.name/
| |
| Bill Rowe 2006-05-17, 4:13 am |
| On 5/15/06 at 11:48 PM, chris@chiasson.name (Chris Chiasson) wrote:
>Did you try that?
Actually, no since what I proposed seemed the obvious way.
>(Mathematica colors the background of the second
>plot white, so showing them both overwrites the contours of the
>first plot with white.
Hmm.. this isn't the result I get For example try
In[15]:=
Show[Block[{$DisplayFunction = Identity},
{ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
ContourShading -> False, PlotPoints -> 50],
ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
ContourShading -> False, Contours -> {0},
ContourStyle -> Red, PlotPoints -> 50]}]];
This results in a graphic with a multitude of black lines and considerably fewer red lines. The default number of contour lines makes this graphic rather difficult to interpret. So, I would use
In[14]:=
Show[Block[{$DisplayFunction = Identity},
{ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
ContourLines -> False, PlotPoints -> 50],
ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
ContourShading -> False, Contours -> {0},
ContourStyle -> Red, PlotPoints -> 50]}]];
which superimposes red contours = 0 over the shaded graphic.
But regardless of your preferences in graphics, I am seeing contours from both contour plots using
In[16]:=
$Version
Out[16]=
5.2 for Mac OS X (June 20, 2005)
--
To reply via email subtract one hundred and four
| |
| David Park 2006-05-17, 4:13 am |
| Chris,
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
DrawGraphics.
Needs["DrawGraphics`DrawingMaster`"]
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@earthlink.net
http://home.earthlink.net/~djmp/
From: Chris Chiasson [mailto:chris@chiasson.name]
Heheh,
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@earthlink.net> wrote:
> On 5/13/06 at 2:42 AM, chris@chiasson.name (Chris Chiasson) wrote:
>
>
>
>
> 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
>
>
--
http://chris.chiasson.name/
| |
| Chris Chiasson 2006-05-19, 4:14 am |
| Bill Rowe,
In the cases presented in your latest email, the option
ContourShading->False removes the Polygons (and shading) normally
present in the output of (one or both) ContourPlot(s). This then makes
it much easier to combine the contours, at the expense of losing the
matching of contour shading to the contours shown. If you were
implying that this option should be used in your first email, I missed
it, which explains why we were on different wavelengths. No problemo.
Regards,
On 5/17/06, Bill Rowe <readnewsciv@earthlink.net> wrote:
> On 5/15/06 at 11:48 PM, chris@chiasson.name (Chris Chiasson) wrote:
>
>
> Actually, no since what I proposed seemed the obvious way.
>
>
> Hmm.. this isn't the result I get For example try
>
> In[15]:=
> Show[Block[{$DisplayFunction = Identity},
> {ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
> ContourShading -> False, PlotPoints -> 50],
> ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
> ContourShading -> False, Contours -> {0},
> ContourStyle -> Red, PlotPoints -> 50]}]];
>
> This results in a graphic with a multitude of black lines and considerably fewer red lines. The default number of contour lines makes this graphic rather difficult to interpret. So, I would use
>
> In[14]:=
> Show[Block[{$DisplayFunction = Identity},
> {ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
> ContourLines -> False, PlotPoints -> 50],
> ContourPlot[Sin[x*y], {x, -5, 5}, {y, -5, 5},
> ContourShading -> False, Contours -> {0},
> ContourStyle -> Red, PlotPoints -> 50]}]];
>
> which superimposes red contours = 0 over the shaded graphic.
>
> But regardless of your preferences in graphics, I am seeing contours from both contour plots using
>
> In[16]:=
> $Version
>
> Out[16]=
> 5.2 for Mac OS X (June 20, 2005)
> --
> To reply via email subtract one hundred and four
>
>
--
http://chris.chiasson.name/
|
|
|
|
|