ListLinePlot

ListLinePlot[{y1,,yn}]

plots a line through the points {1,y1}, , {n,yn}.

ListLinePlot[{{x1,y1},,{xn,yn}}]

plots a line through the points {x1,y1}, , {xn,yn}.

ListLinePlot[{data1,data2,}]

plots lines from all the datai.

ListLinePlot[{,w[datai,],}]

plots datai with features defined by the symbolic wrapper w.

Details and Options

Examples

open allclose all

Basic Examples  (6)

Plot a list of values:

Adding filling under the line:

Plot a list of , pairs:

Plot multiple datasets with a legend:

Plot multiple datasets in a row of panels:

Plot values including units:

Scope  (55)

General Data  (10)

Lines are drawn through the data points:

Use , pairs:

Show multiple sets of data:

The plot range is selected automatically:

Specify what values the data ranges over:

Ranges where the data is nonreal are excluded:

Use InterpolationOrder to smooth the data:

Use MaxPlotPoints to limit the number of points used:

Use PlotRange to focus in on areas of interest:

Use ScalingFunctions to scale the axes:

Special Data  (9)

Use Quantity to include units with the data:

Include different units for the x and y coordinates:

Plot data in a QuantityArray:

Specify the units used with TargetUnits:

Plot data with uncertainty:

Use intervals:

Use bands to represent uncertainty:

Specify strings to use as labels:

Specify a location for labels:

Numeric values in an Association are used as the y coordinates:

Numeric keys and values in an Association are used as the x and y coordinates:

Plot TimeSeries directly with automatic date ticks:

Plot data in a SparseArray:

The weights in WeightedData are ignored:

Data Wrappers  (7)

Use wrappers on data sources or collections of data sources:

Use the value of each point as a tooltip:

Use a specific tooltip for the curve:

Use PopupWindow to provide additional drilldown information:

Button can be used to trigger any action:

Use Annotation for dynamic action when the mouse enters the plot:

Use Hyperlink to jump to the specified link when clicked:

Use StatusArea to display a string in the status area of the current notebook:

Labeling and Legending  (14)

Label data sources with Labeled:

Specify the labels with PlotLabels:

Place the label near the points at an x value:

Use a scaled position:

Specify the text position relative to the point:

Label data automatically with Callout:

Place a label with specific locations:

Specify label names with LabelingFunction:

Specify the maximum size of labels:

Use the full label:

Include legends for each curve:

Use Legended to provide a legend for a specific dataset:

Use Placed to change the legend location:

Use association keys as labels:

Plots usually have interactive callouts showing the coordinates when you mouse over them:

Including specific wrappers or interactions, such as tooltips, turns off the interactive features:

Choose from multiple interactive highlighting effects:

Use Highlighted to emphasize specific points in a plot:

Highlight multiple points:

Presentation  (15)

Multiple curves are automatically colored to be distinct:

Provide explicit styling to different curves:

Use a theme with simple ticks in a bold color scheme:

Include legends for each curve:

Use Legended to provide a legend for a specific dataset:

Add labels:

Provide an interactive Tooltip for the data:

Create filled plots:

Create an overlay mesh:

Use shapes to distinguish different datasets:

Style the curve segments between mesh points:

Show multiple curves in a row of separate panels:

Use a column instead of a row:

Use multiple rows or columns:

Plot the data in a stacked layout:

Plot the data as percentiles of the total of the values:

Use different axes for the different items:

Specify where the axes should be placed:

Place shared axes as well:

Options  (140)

ClippingStyle  (5)

Omit clipped regions of the plot:

Show the 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  (5)

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:

Use Automatic in MeshShading to use the ColorFunction:

ColorFunctionScaling  (2)

Color the line based on scaled value:

Color the line based on unscaled value:

DataRange  (5)

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:

Filling  (8)

Use symbolic or explicit values:

Fills that overlap by default combine using opacity:

Fill between the first curve and the axis:

Fill between two lines:

Fill between curves 1 and 2 with a specific style:

Fill between curves 1 and with light orange:

Fill between curves 1 and 2; use yellow when 1 is below 2, and green when 1 is above 2:

Filling between curves applies where the curves overlap:

FillingStyle  (4)

Use different fill colors:

Fill with opacity 0.5 orange:

Fill with red below the axis, and with blue above:

Use a variable filling style obtained from ColorFunction:

InterpolationOrder  (3)

Points are normally joined with straight lines:

Use quadratic spline interpolation to fit the data:

Use flat regions with steps at each data point:

IntervalMarkers  (3)

By default, uncertainties are capped:

Use bars to denote uncertainties without caps:

Use bands to represent uncertainties:

IntervalMarkersStyle  (2)

Uncertainties automatically inherit the plot style:

Specify the style for uncertainties:

LabelingFunction  (6)

By default, points are automatically labeled with strings:

Use LabelingFunction->None to suppress the labels:

Put the labels above the points:

Use callouts to label the points:

Label the points with their values:

Label the points with their indices:

LabelingSize  (4)

Textual labels are shown at their actual sizes:

Image labels are automatically resized:

Specify a maximum size for textual labels:

Specify a maximum size for image labels:

Show image labels at their natural sizes:

MaxPlotPoints  (4)

All points are included by default:

Uniformly spaced data is downsampled:

In this case, downsampling from to points:

Nonuniform data topologically subsampled, to preserve features:

Points on either side of nonreal data are always included:

Mesh  (5)

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:

Specify style and mesh levels in the direction:

MeshFunctions  (2)

Use a mesh evenly spaced in the and directions:

Show 5 mesh levels in the direction (red) and 10 in the direction (blue):

MeshShading  (6)

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  (4)

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:

MultiaxisArrangement  (5)

By default, all items in a plot share the same scale:

Use different axes for the different items:

Any number of axes can be used:

Have the first and second curves share an axis:

Specify where the axes should be placed:

Place shared axes as well:

PlotHighlighting  (9)

Plots have interactive coordinate callouts with the default setting PlotHighlightingAutomatic:

Use PlotHighlightingNone to disable the highlighting for the entire plot:

Use Highlighted[,None] to disable highlighting for a single set:

Move the mouse over a set of points to highlight it using arbitrary graphics directives:

Move the mouse over the points to highlight them with balls and labels:

Use a ball and label to highlight a specific point on the points:

Move the mouse over the curve to highlight it with a label and droplines to the axes:

Use a ball and label to highlight a specific point in the plot:

Move the mouse over the plot to highlight it with a slice showing values corresponding to the position:

Highlight a particular set of points at a fixed value:

Move the mouse over the plot to highlight it with a slice showing values corresponding to the position:

Highlight the curves at a fixed value:

Use a component that shows the points on the plot closest to the position of the mouse cursor:

Specify the style for the points:

Use a component that shows the coordinates on the points closest to the mouse cursor:

Use Callout options to change the appearance of the label:

Combine components to create a custom effect:

PlotLabel  (1)

Add an overall label to the plot:

PlotLabels  (5)

Specify text to label sets of points:

Place the labels above the points:

Use callouts to identify the points:

Label curves with the keys from an association:

Use None to not label a data source:

PlotLayout  (3)

By default, curves are overlaid on each other:

Plot the data in a stacked layout:

Plot the data as percentiles of the total of the values:

Place each curve in a separate panel using shared axes:

Use rows instead of columns:

Use multiple columns or rows:

Label the individual panels:

PlotLegends  (5)

Generate a legend using labels:

Generate a legend using placeholders:

Legends use the same styles as the plot:

Use Placed to specify legend placement:

Place the legend inside the plot:

Use LineLegend to change the legend appearance:

PlotMarkers  (8)

ListLinePlot 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  (2)

PlotRange is automatically calculated:

Show the whole dataset:

PlotStyle  (6)

Use different style directives:

By default, different styles are chosen for multiple curves:

Explicitly specify the style for different curves:

PlotStyle can be combined with ColorFunction:

PlotStyle can be combined with MeshShading:

MeshStyle by default uses the same style as PlotStyle:

PlotTheme  (3)

Use a theme with simple styling and plot markers in a bright color scheme:

Change the color scheme:

Use a theme with minimal styling:

ScalingFunctions  (9)

By default, plots have linear scales in each direction:

Use a log scale in the direction:

Use a linear scale in the direction that shows smaller numbers at the top:

Use a reciprocal scale in the direction:

Use different scales in the and directions:

Reverse the axis without changing the axis:

Use a scale defined by a function and its inverse:

Positions in Ticks and GridLines are automatically scaled:

PlotRange and AxesOrigin are automatically scaled:

TargetUnits  (2)

Automatically detect units:

Specify alternate units:

Ticks  (10)

Ticks are placed automatically in each plot:

Use TicksNone to draw axes without any tick marks:

Use ticks on the axis, but not the axis:

Place tick marks at specific positions:

Draw tick marks at the specified positions with the specified labels:

Draw tick marks at the specified positions with the specified labels:

Use specific ticks on one axis and automatic ticks on the other:

Specify the lengths for axes as a fraction on graphics size:

Use different sizes in the positive and negative directions for each tick:

Specify a style for each tick:

Construct a function that places ticks at the midpoint and extremes of the axis:

TicksStyle  (4)

By default, the ticks and tick labels use the same styles as the axis:

Specify an overall ticks style, including the tick labels:

Specify ticks style for each of the axes:

Use a different style for the tick labels and tick marks:

Applications  (9)

Compare the n^(th) prime to an estimate:

Show a random walk in one dimension:

Show a random walk in two dimensions:

Random walk on a lattice:

Compute and plot the shortest tour through 100 random points:

Create a stacked line chart:

Show the numbers of graphs with different numbers of nodes available in GraphData:

Show the density at standard temperature and pressure for the elements:

Distribution of Wolfram Language symbols by length:

Plot the sample behavior for different Wolfram Language functions:

Plot the sample order in the , space used by Plot3D:

Properties & Relations  (13)

By default, pairs are interpreted as values:

Interpret the data as multiple data sources:

ListLinePlot is a special case of ListPlot:

Use Plot to visualize functions:

Use ListLogPlot, ListLogLogPlot, and ListLogLinearPlot for logarithmic data plots:

Use ListPolarPlot for polar plots:

Use DateListPlot to show data over time:

Use ListPointPlot3D to show three-dimensional data plots:

Use ListLinePlot3D to plot curves through lists of points:

Plot curves through rows of heights in a table:

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:

Possible Issues  (2)

Limiting the number of points may introduce artifacts:

Use more points to have fewer artifacts:

Unordered data may display in unexpected ways:

Sort the data to interpret as a function:

Wolfram Research (2007), ListLinePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/ListLinePlot.html (updated 2023).

Text

Wolfram Research (2007), ListLinePlot, Wolfram Language function, https://reference.wolfram.com/language/ref/ListLinePlot.html (updated 2023).

CMS

Wolfram Language. 2007. "ListLinePlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/ListLinePlot.html.

APA

Wolfram Language. (2007). ListLinePlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ListLinePlot.html

BibTeX

@misc{reference.wolfram_2023_listlineplot, author="Wolfram Research", title="{ListLinePlot}", year="2023", howpublished="\url{https://reference.wolfram.com/language/ref/ListLinePlot.html}", note=[Accessed: 01-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_listlineplot, organization={Wolfram Research}, title={ListLinePlot}, year={2023}, url={https://reference.wolfram.com/language/ref/ListLinePlot.html}, note=[Accessed: 01-March-2024 ]}