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

ContourPlot

Updated In 6 Graphic
ContourPlot[f, {x, xmin, xmax}, {y, ymin, ymax}]
generates a contour plot of f as a function of x and y.
ContourPlot[fg, {x, xmin, xmax}, {y, ymin, ymax}]
plots contour lines for which f=g.
ContourPlot[{f1g1, f2g2, ...}, {x, xmin, xmax}, {y, ymin, ymax}]
plots several contour lines.
  • ContourPlot 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 contour plot shows through.
  • ContourPlot has attribute HoldAll, and evaluates the fi and gi only after assigning specific numerical values to x and y.
  • In some cases it may be more efficient to use Evaluate to evaluate the fi and gi 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 regions between contour lines
ColorFunctionScalingTruewhether to scale the argument to ColorFunction
ContourLabelsNonehow to label contour levels
ContoursAutomatichow many or what contours to use
ContourShadingAutomatichow to shade regions between contours
ContourStyleAutomaticthe style for contour lines
EvaluationMonitorNoneexpression to evaluate at every function evaluation
ExclusionsAutomaticx, y curves to exclude
ExclusionsStyleNonewhat to draw at excluded curves
FrameTruewhether to put 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{}how to determine the placement of mesh lines
MeshStyleAutomaticthe style for mesh lines
MethodAutomaticthe method to use for refining contours
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotPointsAutomaticthe initial number of sample points 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
  • ContourPlot[{f1g1, f2g2, ...}, ...] superimposes the contour lines associated with all of the equalities figi.
  • ContourPlot 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 ContourPlot to miss features of your functions. To check your results, you should try increasing the settings for PlotPoints and MaxRecursion.
  • With some settings for PerformanceGoal, other specific option settings may be overridden.
  • ColorFunction is supplied with a single argument, given by default by the average of the scaled values of f for each pair of successive contour levels.
  • With the default settings Exclusions->Automatic and ExclusionsStyle->None, ContourPlot breaks continuity in its sampling at any discontinuity curve it detects. The discontinuity is immediately visible only if it jumps out of a particular contour level.
New in 1 | Last modified in 6