Getting mathematica to take more points when it plots

Click For Summary

Discussion Overview

The discussion revolves around the challenges of plotting functions in Mathematica, particularly when dealing with complex functions that require a high number of points for accurate representation. Participants explore how to adjust the number of points used in plots, including contour plots, to achieve smoother curves and better visualizations.

Discussion Character

  • Technical explanation
  • Conceptual clarification
  • Debate/contested

Main Points Raised

  • One participant describes issues with Mathematica not using enough points in plots, leading to straightened curves instead of smooth representations, especially in high-frequency cases.
  • Another participant suggests using the PlotPoints option for normal plots and indicates there may be a similar option for contour plots, though they need to verify this.
  • A participant expresses satisfaction with the solution provided, noting that while increasing the number of points improves plot quality, it also significantly increases calculation time.
  • Another participant mentions that when plotting an interpolating function, the number of points calculated may depend on the range of the function rather than the specified plot range in certain cases.

Areas of Agreement / Disagreement

Participants generally agree on the need to adjust the number of points for better plot quality, but there are nuances regarding how Mathematica determines the number of points based on different contexts, which remains somewhat unresolved.

Contextual Notes

There are limitations regarding the specific options available for contour plots and how the calculation time is affected by the number of points, which may depend on the complexity of the function being plotted.

rynlee
Messages
44
Reaction score
0
I've had this problem many times in the past, and haven't thought of a way to fix it.

Sometimes when I plot a function that requires quite a bit of effort on mathematica's part, (for example, one time the function was a sum of about a thousand terms, each of which was multiplied complex terms with my independent variable dependence (in this case time)), when it plots it the plot is correct but for some reason doesn't take enough points, it's not nicely curved as it should be but instead looks like connected line segments. When I have a particularly high frequency plot this is particularly troublesome, as features get washed out sometimes and curves are straightened.

Most recently I am plotting a contour plot where there are oscillations in each of the variables, and mathematica is turning the contour basically into polygons.

Is there a way to get mathematica to use more points when constructing a plot? Is that the source of this grievance?

Thanks for any Advice
 
Physics news on Phys.org
For normal plots its PlotPoints->x, for contour I would have to double check (munching on breakfast atm) but it should be in help under options somewhere (if it is not the same as above)
 
thanks! that really did the trick, I'm amazed at how few points mathematica actually takes. That said I'm glad for its low plot points by default - cranking it up really increases the calculation time, it looks like when PlotPoints is set to automatic, it tries to keep the calculation time reasonable.
 
No worries. Also I've found if you're plotting say an interpolating function which is valid over a given range, it will calculate the number of points to use based on that range rather than the plot range, at least in certain instances.
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
3K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 1 ·
Replies
1
Views
7K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 4 ·
Replies
4
Views
5K
  • · Replies 2 ·
Replies
2
Views
2K