|
SOLUTIONS
|
BUILT-IN MATHEMATICA SYMBOL
DensityPlot[f, {x, xmin, xmax}, {y, ymin, ymax}]
makes a density plot of f as a function of x and y.
Details and OptionsDetails and Options
- DensityPlot by default generates colorized grayscale output, in which larger values are shown lighter.
- At positions where f does not evaluate to a real number, holes are left so that the background to the density plot shows through.
- DensityPlot treats the variables x and y as local, effectively using Block.
- DensityPlot has attribute HoldAll, and evaluates f only after assigning specific numerical values to x and y.
- In some cases it may be more efficient to use Evaluate to evaluate f symbolically before specific numerical values are assigned to x and y.
- The plot is left blank in any regions where f evaluates to None.
- DensityPlot has the same options as Graphics, with the following additions and changes:
-
AspectRatio 1 ratio of height to width BoundaryStyle None how to draw RegionFunction boundaries BoxRatios Automatic effective 3D bounding box ratios ClippingStyle None how to draw values clipped by PlotRange ColorFunction Automatic how to color the plot ColorFunctionScaling True whether to scale the argument to ColorFunction EvaluationMonitor None expression to evaluate at every function evaluation Exclusions Automatic x, y curves to exclude ExclusionsStyle None what to draw at excluded curves Frame True whether to draw a frame around the plot FrameTicks Automatic frame tick marks LightingAngle None effective angle of the simulated light source MaxRecursion Automatic the maximum number of recursive subdivisions allowed Mesh None how many mesh lines in each direction to draw MeshFunctions {#1&,#2&} how to determine the placement of mesh lines MeshStyle Automatic the style for mesh lines Method Automatic the method to use for refining the plot PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotLegends None legends for color gradients PlotPoints Automatic the initial number of sample points for the function in each direction PlotRange {Full,Full,Automatic} the range of f or other values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values RegionFunction (True&) how to determine whether a point should be included WorkingPrecision MachinePrecision the precision used in internal computations - Typical settings for PlotLegends include:
-
None no legend Automatic automatically determine legend from ColorFunction Placed[lspec,...] specify placement for legend - DensityPlot initially evaluates f at a grid of equally spaced sample points specified by PlotPoints. Then it uses an adaptive algorithm to subdivide at most MaxRecursion times to generate smooth contours.
- You should realize that since it uses only a finite number of sample points, it is possible for DensityPlot to miss features of your functions. To check your results, you should try increasing the settings for PlotPoints and MaxRecursion.
- With the setting Mesh->All, DensityPlot draws mesh lines to show all the subdivisions it uses.
- The default setting MeshFunctions->{#1&, #2&} draws an x, y mesh.
- The arguments supplied to functions in MeshFunctions and RegionFunction are x, y, f.
- ColorFunction is supplied with a single argument, given by default by the scaled value of f.
- With the default settings Exclusions->Automatic and ExclusionsStyle->None, DensityPlot breaks continuity in the density it displays at any discontinuity curve it detects.
- DensityPlot returns Graphics[GraphicsComplex[data]].
New in 1 | Last modified in 9
Mathematica 9 is now available!
New to Mathematica?
Find your learning path »
Have a question?
Ask support »





