This is documentation for Mathematica 6, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)


Updated In 6 Graphic
DensityPlot[f, {x, xmin, xmax}, {y, ymin, ymax}]
makes a density plot of f as a function of x and y.
  • 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 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.
AspectRatio1ratio of height to width
BoundaryStyleNonehow to draw RegionFunction boundaries
ClippingStyleNonehow to draw values clipped by PlotRange
ColorFunctionAutomatichow to color the plot
ColorFunctionScalingTruewhether to scale the argument to ColorFunction
EvaluationMonitorNoneexpression to evaluate at every function evaluation
ExclusionsAutomaticx, y curves to exclude
ExclusionsStyleNonewhat to draw at excluded curves
FrameTruewhether to draw a frame around the plot
FrameTicksAutomaticframe tick marks
MaxRecursionAutomaticthe maximum number of recursive subdivisions allowed
MeshNonehow many mesh lines in each direction to draw
MeshFunctions{#1&,#2&}how to determine the placement of mesh lines
MeshStyleAutomaticthe style for mesh lines
MethodAutomaticthe method to use for refining the plot
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotPointsAutomaticthe initial number of sample points for the function in each direction
PlotRange{Full,Full,Automatic}the range of f or other values to include
PlotRangeClippingTruewhether to clip at the plot range
PlotRangePaddingAutomatichow much to pad the range of values
RegionFunction(True&)how to determine whether a point should be included
WorkingPrecisionMachinePrecisionthe precision used in internal computations
  • 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.
  • ColorFunction is supplied with a single argument, given by default by the scaled value of f.
New in 1 | Last modified in 6