How to | Make a Smoother or Rougher Plot
The Wolfram Language gives you the ability to fine-tune the level of detail for your plots. To get a rough sketch of a plot, you can tell the Wolfram Language to plot fewer points. The more points you have in a plot, the more detailed the results will be.
First, plot a simple function:
Set the option Mesh->All to see the default sample points that the Wolfram Language uses:
You can adjust the number of sample points plotted with PlotPoints. MaxRecursion controls how many recursive subdivisions can be made:
Setting values for PlotPoints and MaxRecursion high makes a very detailed picture at the cost of speed. AbsoluteTiming prints how long (in seconds) it takes to evaluate:
Smaller values for PlotPoints and MaxRecursion give a rougher but much faster result:
You can get a misleading result if these parameter values are chosen poorly. This is the accurate plot produced by the Wolfram Language's default settings:
Setting PlotPoints too low yields a misleading result:
You can compensate for a low PlotPoints value by increasing MaxRecursion, but this will often take much longer, and may still be inaccurate: