This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.

# DiscretePlot

 DiscretePlot generates a plot of the values of expr when n runs from to . DiscretePlotgenerates a plot of the values of expr when n runs from to . DiscretePlotuses steps dn. DiscretePlotuses the successive values , , .... DiscretePlotplots 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
 AspectRatio 1/GoldenRatio ratio of height to width Axes True whether to draw axes ClippingStyle None what to draw when lines are clipped ColorFunction Automatic how to determine the coloring of lines ColorFunctionScaling True whether to scale arguments to ColorFunction EvaluationMonitor None expression to evaluate at every function evaluation ExtentElementFunction Automatic how to generate raw graphics for extent fills ExtentMarkers None markers to use for extent boundaries ExtentSize None width to extend from plot point Filling Axis filling from extent FillingStyle Automatic style to use for filling Joined Automatic whether to join points Method Automatic what method to use PerformanceGoal \$PerformanceGoal aspects of performance to try to optimize PlotMarkers None markers to use for plot points PlotRange Automatic range of values to include PlotRangeClipping True whether to clip at the plot range PlotStyle Automatic graphics directives to determine the style of each line RegionFunction (True &) how to determine whether a point should be included WorkingPrecision MachinePrecision precision 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 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:
 Out[1]=
 Out[2]=

Plot several sequences:
 Out[2]=

Show a Riemann sum approximation to the area under a curve:
 Out[1]=
With bars to the left and right of the sample points:
 Out[2]=
 Scope   (9)
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:
 Options   (56)
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:
 Applications   (4)
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: