Making the Most of the Visualization Functions

Understanding PerformanceGoal

Ulises Cervantes-Pimentel
Brett Champion

Wolfram Research, Inc.

Understanding PerformanceGoal

Used to tune between "fast" and "good" results

Toggles automatically inside Manipulate

Flexible setting of options

Generally set to be $PerformanceGoal

Automatic Tuning of Options: Function-based

Decreases PlotPoints

Turns off MaxRecursion

Turns off overlay meshes

Doesn't calculate Exclusions

Switches visualization pipeline

Manipulate[SphericalPlot3D[1+Sin[4θ]Sin[4 ϕ]/k,{θ,0,π},{ϕ,0,2π}],
{k,1,10}]

Automatic Tuning of Options: List-based

Decreases MaxPlotPoints

Turns off overlay meshes

Switches visualization pipeline

data=Table[Exp[-x^2-y^2],{x,-2,2,0.1},{y,-2,2,0.1}];

Dimensions[data]

Manipulate[ListPlot3D[k data],{k,1,10}]

Automatic Tuning of Options: Flexibility

Explicit option settings are preserved!

For example, setting MaxRecursion to a number will still reduce the number of plot points, turn off the overlay mesh, and turn off exclusions. But the recursion setting will be respected.

Manipulate[SphericalPlot3D[1+k Sin[4θ]Sin[4 ϕ],{θ,0,π},{ϕ,0,2π},Mesh->mesh,PlotPoints->pp,MaxRecursion->mr,ColorFunction->"Rainbow"],
{k,0,1},{pp,{Automatic,10,20,30}},{mr,{Automatic,0,1,2,3}},{mesh,{Automatic,All,None,10}}]

$PerformanceGoal

Generally evaluates to "Quality"

Evaluates to "Speed" when Manipulate controls are active

Manipulate[Column[{$PerformanceGoal, Plot[Sin[a+x],{x,0,2Pi}]}],{a,0,10}]

$PerformanceGoal can be set inside Block[] etc...

Manipulate[Block[{$PerformanceGoal="Quality"},
{DensityPlot[Sin[x y^2],{x,0,a},{y,0,b}],
DensityPlot[Sin[x^2y],{x,0,a},{y,0,b}]}],{a,1,4},{b,1,4}]

Manipulate[
{DensityPlot[Sin[x y^2],{x,0,a},{y,0,b}],
DensityPlot[Sin[x^2y],{x,0,a},{y,0,b}]},{a,1,4},{b,1,4}]