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


Updated In 8 Graphic
generates a plot of the values of expr when n runs from to .
generates a plot of the values of expr when n runs from to .
uses steps dn.
uses the successive values , , ....
plots the values of all the .
  • DiscretePlot uses the standard Mathematica iterator specification.
  • DiscretePlot has attribute HoldAll, and evaluates expr only after assigning specific numerical values to n.
  • In some cases it may be more efficient to use Evaluate to evaluate expr symbolically before specific numerical values are assigned to n.
  • The precision used in evaluating expr is the minimum precision used in the iterator.
  • The form provides a wrapper w to be applied to the resulting graphics primitives.
  • The following wrappers can be used:
Annotation[expr,label]provide an annotation
Button[expr,action]define an action to execute when the element is clicked
EventHandler[expr,...]define a general event handler for the element
Hyperlink[expr,uri]make the element act as a hyperlink
PopupWindow[expr,cont]attach a popup window to the element
StatusArea[expr,label]display in the status area when the element is moused over
Style[expr,opts]show the element using the specified styles
Tooltip[expr,label]attach an arbitrary tooltip to the element
AspectRatio1/GoldenRatioratio of height to width
AxesTruewhether to draw axes
ClippingStyleNonewhat to draw when lines are clipped
ColorFunctionAutomatichow to determine the coloring of lines
ColorFunctionScalingTruewhether to scale arguments to ColorFunction
EvaluationMonitorNoneexpression to evaluate at every function evaluation
ExtentElementFunctionAutomatichow to generate raw graphics for extent fills
ExtentMarkersNonemarkers to use for extent boundaries
ExtentSizeNonewidth to extend from plot point
FillingAxisfilling from extent
FillingStyleAutomaticstyle to use for filling
JoinedAutomaticwhether to join points
MethodAutomaticwhat method to use
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotMarkersNonemarkers to use for plot points
PlotRangeAutomaticrange of values to include
PlotRangeClippingTruewhether to clip at the plot range
PlotStyleAutomaticgraphics directives to determine the style of each line
RegionFunction(True &)how to determine whether a point should be included
WorkingPrecisionMachinePrecisionprecision for internal computation
  • With the setting ExtentSize, a horizontal line is drawn around each plot point, extending to the left and to the right. With ExtentMarkers, the markers and will be used as left and right extent boundary markers.
  • With the default settings Joined->Automatic and Filling->Axis, DiscretePlot switches between drawing points with a stem filling when there are few points, and lines with a solid filling when there are many points.
Plot a sequence:
Plot several sequences:
Show a Riemann sum approximation to the area under a curve:
With bars to the left and right of the sample points:
Plot a sequence:
Click for copyable input
Click for copyable input
Plot several sequences:
Click for copyable input
Click for copyable input
Show a Riemann sum approximation to the area under a curve:
Click for copyable input
With bars to the left and right of the sample points:
Click for copyable input
Plot multiple functions:
Use wrappers on functions or sets of functions:
Wrappers can be nested:
Override the default tooltips:
Use PopupWindow to provide additional drilldown information:
Button can be used to trigger any action:
Use an explicit list of styles for the plots:
Style can be used to override styles:
Use any graphic for PlotMarkers:
Use any gradient or indexed color schemes from ColorData:
Use ExtentSize to associate a region with a point:
Show extent markers:
Use labels based on variables specified in DiscretePlot:
Specify a label for each axis:
Color by scaled and coordinates, respectively:
Color joined plots:
Color filling element functions:
Color by height with a named color scheme:
Identify where jumps:
ColorFunction has higher priority than PlotStyle:
No argument scaling on the left; automatic scaling on the right:
Identify where jumps:
Gather the plotted heights:
Show the plot and a histogram of the heights:
Get a list of built-in settings for ExtentElementFunction:
For detailed settings use PalettesChartElementSchemes:
This ChartElementFunction is appropriate to show the global scale:
Write a custom ExtentElementFunction:
Built-in element function may have options; use PalettesChartElementSchemes to set them:
Do not show the extent endpoints:
Use points to show the extent endpoints:
Show with appropriate continuity markers:
Show with appropriate continuity markers:
Control the size of markers:
Use custom shapes for the markers:
Markers use the settings for PlotStyle:
Show heights as points:
Draw full regions around the heights:
With unevenly spaced points:
Use fixed-size regions:
With unevenly spaced points:
Use sizes relative to the distance between points:
With unevenly spaced points:
Use equally sized regions that do not overlap:
With unevenly spaced points:
Control the placement of the region around the points:
DiscretePlot automatically fills to the axis:
Turn off filling:
Use symbolic or explicit values:
With Joined->True:
Fill between curves 1 and 2:
Fill between curves 1 and 2 with a specific style:
Fill between curves 1 and 2; use red when 1 is below 2, and blue when 1 is above 2:
Use different fill colors:
Fill with opacity 0.5 orange:
Fill with red below the axis and blue above:
Use a variable filling style obtained from a ColorFunction:
Plots are automatically joined when there are many points:
Join the points:
Do not join the points:
DiscretePlot normally uses distinct colors to distinguish different sets of data:
Automatically use colors and shapes to distinguish sets of data:
Markers are placed at the plot points regardless of the setting for ExtentSize:
Change the size of the default plot markers:
Use arbitrary text for plot markers:
Use explicit graphics for plot markers:
Use the same symbol for all the sets of data:
Explicitly use a symbol and size:
Use different style directives:
By default different styles are chosen for multiple curves and regions:
Explicitly specify the style for different curves and regions:
PlotStyle can be combined with ColorFunction:
Draw over the region where :
Evaluate functions using machine-precision arithmetic:
Evaluate functions using arbitrary-precision arithmetic:
Plot the PDF of the empirical distribution of univariate data:
The CDF is a piecewise constant function:
Visualize the PDF and CDF for a discrete distribution:
Show Riemann sum approximations to the area under a curve:
Plot how many primes are below a number:
Plot generates continuous curves:
Use ListPlot to plot lists of values:
Use BarChart to show bars for lists of values:
Use DiscretePlot3D to plot functions of two discrete variables:
New in 7 | Last modified in 8