Mathematica Optimizing Resolution in RegionPlot for Complex Conditions in Mathematica 6

  • Thread starter Thread starter dukebdx12
  • Start date Start date
  • Tags Tags
    Mathematica
AI Thread Summary
The discussion focuses on optimizing resolution in Mathematica's RegionPlot for complex conditions. A user seeks guidance on creating surface and contour plots for functions like f(x,y) = cos(xy) within specified intervals. Key points include adjusting plot limits, viewpoints, and resolutions, with suggestions to manipulate sampling frequency and working precision for better output quality. Additionally, using options like PerformanceGoal and MaxRecursion can significantly enhance plot resolution and quality. The conversation emphasizes the importance of experimenting with these parameters to achieve optimal results in Mathematica.
dukebdx12
Messages
9
Reaction score
0
can someone help me out with a mathematica problem ( i use mathematica 6)? I have never used this program before and really don't know what to do or where to start. So if someone could give me a little light that would be great.

http://i29.tinypic.com/25rkn5f.jpg

-last graph is g(x,y)=
 
Last edited:
Physics news on Phys.org
These must have been produced by Plot3D in Math'ca.

For example,

Plot3D[Cos[x y], {x, -3 \[Pi], 3 \[Pi]}, {y, -3 \[Pi], 3 \[Pi]}]

then shift+enter.

First thing I'd do is to hold & rotate the graph to change the ViewPoint.

To change it explicitly, you can type for example:

Plot3D[Cos[x y], {x, -3 \[Pi], 3 \[Pi]}, {y, -3 \[Pi], 3 \[Pi]}, ViewPoint -> {-1, 0, -3}]

Another thing to try is to change the plot limits from {x, -3 \[Pi], 3 \[Pi]} to (say) {x, -\[Pi], \[Pi]} (same for y).
 
ok thanks for the reply. my question is, it says make surface and contour plots for suitable intervals, viewpoints, and resolutions. For example f(x,y) = cos(xy) for -3pi <= x,y <= 3pi , that is 1 of the equations for the question. So to make surface and contour plots(many of them) do I just plug other numbers in for -3pi and 3pi? Confused on what I need to do.
 
You should make a surface plot and a contour plot for:

a. suitable intervals,

b. suitable viewpoints, and

c. suitable resolutions

for each function f, g, etc.

"Plugging other numbers in for -3pi and 3pi" addresses item a.
 
i've got it all down now except the resolutions. I have tried searching for it on google and mathematica and i can't find anything on how to do it. It says. to draw surface and contour plots for resolutions. I don't know what that means? can someone explain?
 
try searching in the master index in mathematica it is very good (help -> master index)
 
My guess is, "resolution" means "density" of the plot. For example in a ContourPlot, the number of contours you specify manually, as an option.

Alternatively, resolution can mean sampling frequency. Mathematica has a default sampling frequency when plotting graphs. You can change it by specifying a step size as part of the domain specification. For example:

{x, -\[Pi], \[Pi]} produces default sampling

{x, -\[Pi], \[Pi], \[Pi]/180} produces sampling along the x-axis with step size = 1 degree.
 
Last edited:
I noticed that a version of convert-pdf was used. If that free trial runs out, try searching for "cute pdf"...

sorry i didn't have anything of much value to add other than that...
 
Re my last post above:

If {x, -\[Pi], \[Pi], \[Pi]/180} doesn't work try putting in the option WorkingPrecision -> value in the Plot statement where the default value is MachinePrecision but you can specify a numeric value to increase plot precision (e.g. WorkingPrecision -> 20).

You can also experiment with Mesh and MeshFunctions options. For example:
Plot[Tan[x], {x, 0, Pi/2}, Mesh -> {5, 10}, MeshFunctions -> {#1 &, #2 &}]
 
Last edited:
  • #10
I have struggled with bad resolution and quality in RegionPlot for a long time. In particular this is a problem for complicated multiple conditions. The way to solve it is to add PerformanceGoal and MaxRecursion:

RegionPlot[ f(x,y)>0 && g(x,y)>0, {x,xmin,xmax},{y,ymin,ymax},
PerformanceGoal -> "Quality", MaxRecursion -> 8]

I suspect that the default values are PerformanceGoal -> "Speed", MaxRecursion -> 1. The speed and quality seems to be very sensitive to MaxRecursion, so experiment a bit with different values.

( google keywords: resolution RegionPlot Mathematica )
 

Similar threads

Replies
4
Views
2K
Replies
23
Views
3K
Replies
3
Views
2K
Replies
6
Views
4K
Replies
2
Views
2K
Replies
6
Views
8K
Replies
2
Views
2K
Back
Top