ListPlot

ListPlot[{y1, y2, ...}]
plots points corresponding to a list of values, assumed to correspond to x coordinates 1, 2, ... .

ListPlot[{{x1, y1}, {x2, y2}, ...}]
plots a list of points with specified x and y coordinates.

ListPlot[{list1, list2, ...}]
plots several lists of points.

Details and OptionsDetails and Options

  • 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
    PlotLegendsNonelegends for datasets
    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[{list1, list2, ...}] by default uses different colors to indicate points from different .
  • Interactive labeling can be specified for points or lists of points using Tooltip, StatusArea, or Annotation.
  • Tooltip[yi] or Tooltip[{xi, yi}] 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[list, label] gives the specified tooltip label for all points in list.
  • Typical settings for PlotLegends include:
  • Noneno legend
    Automaticautomatically determine legend
    {lbl1,lbl2,...}use , , ... as legend labels
    Placed[lspec,...]specify placement for legend
  • Legended[list, label] gives the specified legend label for the points defined by list.
  • ListPlot[list, Joined->True] draws a line through the data, just like ListLinePlot[list].
  • ListPlot[{list1, list2, ...}, Joined->{s1, s2, ...}] gives specifications for whether to join the points in each of the .
  • In the case Joined->True, ListPlot uses the additional options of ListLinePlot.
  • ListPlot[{list1, list2, ...}] by default takes the x coordinates for successive points in each of the to be successive integers starting at 1.
  • The setting DataRange->{xmin, xmax} 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[{{a11, a12}, ..., {an1, an2}}] 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.
  • ListPlot[list, DataRange->All] always takes list to represent a list of separate datasets.
  • The can be SparseArray objects.
  • With the setting PlotStyle->{style1, style2, ...}, the are used cyclically to determine the styles of points in each of the .
  • ListPlot returns Graphics[{Point[...], ...}], Graphics[{Inset[...], ...}], etc.
New in 1 | Last modified in 9
New to Mathematica? Find your learning path »
Have a question? Ask support »