Message Boards Message Boards

GROUPS:

Problem with PlotRange as an option to ContourPlot

Posted 2 months ago
304 Views
|
2 Replies
|
1 Total Likes
|

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) ]
2 Replies
Posted 2 months ago

Perfect! I should have thought about it myself.

Thanks a lot.

Posted 2 months 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}
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