BUILT-IN MATHEMATICA SYMBOL

# DiscretePlot

DiscretePlot[expr, {n, nmax}]
generates a plot of the values of expr when n runs from to .

DiscretePlot[expr, {n, nmin, nmax}]
generates a plot of the values of expr when n runs from to .

DiscretePlot[expr, {n, nmin, nmax, dn}]
uses steps dn.

DiscretePlot[expr, {n, {n1, n2, ...}}]
uses the successive values , , ... .

DiscretePlot[{expr1, expr2, ...}, ...]
plots the values of all the .

## Details and OptionsDetails and Options

• DiscretePlot uses the standard Mathematica iterator specification.
• DiscretePlot treats the variable n as local, effectively using Block.
• 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
• DiscretePlot has the same options as Graphics, with the following additions and changes:
•  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 PlotLegends None legends for sequences 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
• The arguments supplied to ColorFunction are , .
• With the setting ExtentSize->{sl, sr}, a horizontal line is drawn around each plot point, extending to the left and to the right. With ExtentMarkers->{ml, mr}, the markers and will be used as left and right extent boundary markers.
• With the default settings and , 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.
• The arguments supplied to ExtentElementFunction are the element region and the sample point .
• With the setting , is equal to . With the setting , is equal to .

## ExamplesExamplesopen allclose all

### Basic Examples (3)Basic Examples (3)

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]=

## See AlsoSee Also

New in 7 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »