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

ListPlot

ListPlot
plots points corresponding to a list of values, assumed to correspond to x coordinates 1, 2, ....
ListPlot
plots a list of points with specified x and y coordinates.
ListPlot
plots several lists of points.
  • ListPlot has the same options as Graphics, with the following additions and changes:
AspectRatio1/GoldenRatioratio of height to width
AxesTruewhether to draw axes
DataRangeAutomaticthe range of x values to assume for data
FillingNonehow to fill in stems for each point
FillingStyleAutomaticstyle to use for filling
JoinedFalsewhether to join points
PerformanceGoal$PerformanceGoalaspects of performance to try to optimize
PlotMarkersNonemarkers to use to indicate each point
PlotRangeAutomaticrange of values to include
PlotRangeClippingTruewhether to clip at the plot range
PlotStyleAutomaticgraphics directives to determine styles of points
  • ListPlot by default uses different colors to indicate points from different .
  • Tooltip or Tooltip indicates that the coordinates of a point should be displayed in its tooltip.
  • Tooltip[list] specifies that coordinate tooltips should be displayed for all points in the list.
  • Tooltip gives the specified tooltip label for all points in list.
  • ListPlot[{list1, list2, ...}, Joined->{s1, s2, ...}] gives specifications for whether to join the points in each of the .
  • ListPlot by default takes the x coordinates for successive points in each of the to be successive integers starting at 1.
  • The setting DataRange specifies other ranges of x coordinates to use, with being associated with the last element in the longest of the .
  • With the default setting DataRange->Automatic, ListPlot will be taken to give x and y values for n separate points, rather than y values for n separate datasets each containing two points.
  • With the setting PlotStyle, the are used cyclically to determine the styles of points in each of the .
Plot a list of values:
Plot a list of , pairs:
Plot several datasets:
Plot a list of values:
In[1]:=
Click for copyable input
Out[1]=
 
Plot a list of , pairs:
In[1]:=
Click for copyable input
Out[1]=
 
Plot several datasets:
In[1]:=
Click for copyable input
Out[1]=
For regular data consisting of values, the data range is taken to be integer values:
Provide an explicit data range by using DataRange:
Plot multiple sets of regular data:
For irregular data consisting of value pairs, the data range is inferred from data:
Plot multiple sets of irregular data:
Plot multiple sets of data, regular or irregular, using DataRange to map them to the same range:
Ranges where the data is nonreal are excluded:
Use MaxPlotPoints to limit the number of points used:
PlotRange is selected automatically:
Use PlotRange to focus on areas of interest:
Multiple datasets are automatically colored to be distinct:
Provide explicit styling to different sets:
Add labels:
Provide an interactive Tooltip for the data:
Create filled plots:
Use shapes to distinguish different datasets:
Use labels to distinguish different datasets:
Use Joined to connect datasets with lines:
Use InterpolationOrder to smooth joined data:
Use SparseArray to plot values represented by rules:
Choose the ratio of height to width from the actual plot values:
Set the ratio to 1:
Specify labels for the and axes:
The locations of the axes are determined automatically:
Specify where the axes cross:
ClippingStyle requires at least one dataset to be Joined:
Omit clipped regions of the plot:
Show clipped regions like the rest of the curve:
Show clipped regions with red lines:
Show clipped regions as red at the bottom and thick at the top:
Show clipped regions as red and thick:
ColorFunction requires at least one dataset to be Joined:
Color by scaled and coordinates:
Color with a named color scheme:
Fill with the color used for the curve:
ColorFunction has higher priority than PlotStyle for coloring the curve:
ColorFunctionScaling requires at least one dataset to be Joined:
Color the line based on the scaled value:
Color the line based on the unscaled value:
Lists of height values are displayed against the number of elements:
Rescale to the sampling space:
Each dataset is scaled to the same domain:
Pairs are interpreted as , coordinates:
Specifying DataRange in this case has no effect, since values are part of the data:
Force interpretation as multiple datasets:
Use symbolic or explicit values for "stem" filling:
Fill between corresponding points in two datasets:
Fill between datasets using a particular style:
Fill between datasets 1 and 2; use red when 1 is less than 2 and blue otherwise:
Fill to the axis for irregularly sampled data:
Use several irregular datasets; filling between them will use the first as the reference:
Joined datasets fill with solid areas:
The type of filling depends on whether the first set is joined:
Fill with blue "stems":
Fill with dashed magenta "stems":
Fill with red below the axis, and with blue above:
Filling for Joined cases is solid:
Joined lines can be interpolated:
By default linear interpolation is used:
Use zero-order or piecewise-constant interpolation:
Use third-order spline interpolation:
Interpolation order 0 to 5:
Join the dataset with a line:
Join the first dataset with a line, but use points for the second dataset:
Join the dataset with a line and show the original points:
The type of filling depends on whether the set is joined:
All points are included by default:
Uniformly spaced data is downsampled:
In this case downsampling from to points:
Nonuniform data is topologically subsampled to preserve features:
Mesh requires at least one dataset to be Joined:
The initial and final sampling meshes are typically the same:
Interpolated data may introduce points:
Use 20 mesh levels evenly spaced in the direction:
Use an explicit list of values for the mesh in the direction:
Use explicit styles at specific points:
MeshFunctions requires at least one dataset to be Joined:
Use a mesh evenly spaced in the and directions:
Show 5 mesh levels in the direction (red) and 10 in the direction (blue):
MeshShading requires at least one dataset to be Joined:
Alternate red and blue segments of equal width in the direction:
Use None to remove segments:
MeshShading can be used with PlotStyle:
MeshShading has higher priority than PlotStyle for styling the curve:
Use PlotStyle for some segments by setting MeshShading to Automatic:
MeshShading can be used with ColorFunction:
MeshStyle requires at least one dataset to be Joined:
Color the mesh the same color as the plot:
Use a red mesh in the direction:
Use a red mesh in the direction and a blue mesh in the direction:
Use big red mesh points in the direction:
ListPlot normally uses distinct colors to distinguish different sets of data:
Automatically use colors and shapes to distinguish sets of data:
Use shapes only:
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:
PlotRange is automatically calculated:
Show the whole dataset:
Use different style directives:
By default, different styles are chosen for multiple datasets:
Explicitly specify the style for different datasets:
PlotStyle applies to both lines and points:
PlotStyle can be combined with ColorFunction:
PlotStyle can be combined with MeshShading:
MeshStyle by default uses the same style as PlotStyle:
Compare the n^(th) prime to an estimate:
Show the evaluation points in order used by a numerical function:
Show both evaluation points and value used by a numerical function:
Plot life expectancy against birth rates for all the countries:
Show the linear relationship between enthalpy of vaporization and boiling point:
Plot a discrete-time signal and its spectrum:
Plot the probability mass function for a distribution:
Plot the empirical probability mass function:
Plot a solution sequence to a difference equation:
Plot randomly sampled properties:
ListLinePlot is a special case of ListPlot:
Use Plot for functions:
Use ListLogPlot, ListLogLogPlot, and ListLogLinearPlot for logarithmic plots:
Use ListPolarPlot for polar plots:
Use DateListPlot to show data over time:
Use ListPointPlot3D to show three-dimensional points:
Use ListPlot3D to create surfaces from data:
Use ListContourPlot to create contours from continuous data:
Use ListDensityPlot to create densities from continuous data:
Use ArrayPlot and MatrixPlot for arrays of discrete values:
Use ParametricPlot for parametric curves:
New in 1 | Last modified in 6