Message Boards Message Boards

0
|
2236 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

Problem with PlotRange as an option to ContourPlot

Posted 3 years ago

Please help me solve a "clipping" issue arising in a Plot I am working on.

Compare these two commands: Definition for the surface surf is at the end on the post.

1.

ContourPlot[surf[y, x], {x, 0, 1024}, {y, 0, 256},
 ColorFunction -> "DarkRainbow",
 PlotRange -> All]

2.

ContourPlot[surf[y, x], {x, 0, 1024}, {y, 0, 256},
 ColorFunction -> "DarkRainbow",
 PlotRange -> {{0, 1024}, {0, 256}}]

enter image description here

The first one looks fine, you can see all the contours.

But for the second one, some of the contours disappear and the colors turn to white at the center of the plot.

Beside that, plot #1 is not Framed, whereas plot #2 is.

Why is that?

Definition for surf:

A = 800000;
a = 80;
b = 0.0007;
surf = Function[{x, y}, 
  A (Exp[-b (x - 90)^2] + Exp[-b (x - 90 - 70)^2])/((y - 512)^2 + a^2) ]
POSTED BY: Ehud Behar
2 Replies
Posted 3 years ago

For ContourPlot, PlotRange has a 3rd argument for the "height" of the contour plot. Try

PlotRange -> {{0, 1024}, {0, 256}, All}

The default is

{Full, Full, Automatic}
POSTED BY: Jim Baldwin
Posted 3 years ago

Perfect! I should have thought about it myself.

Thanks a lot.

POSTED BY: Ehud Behar
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract