Getting mathematica to take more points when it plots

Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
3 replies · 3K views
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.