StackedListPlot
StackedListPlot[{data1,data2,…}]
plots lines for each of the datai, with the i curve being the accumulation of values in data1 through datai.
StackedListPlot[{…,w[datai],…}]
plots datai with features defined by the symbolic wrapper w.
Details and Options
- The datai have the following forms and interpretations:
-
{y1,y2,…} heights {y1,y2,…} with automatic x values {{x1,y1},{x2,y2},…} values {{x1,y1},{x2,y2},…} <"k1"y1,"k2"y2,… > values {y1,y2,…} <x1y1,x2y2,… > key-value pairs {{x1,y1},{x2,y2},…} {y1"lbl1",y2"lbl2",…}, {y1,y2,…}{"lbl1","lbl2",…} values {y1,y2,…} with labels {lbl1,lbl2,…} SparseArray values as a normal array TimeSeries, EventSeries time-value pairs QuantityArray magnitudes WeightedData unweighted values - Data values xi and yi can be given in the following forms:
-
xi a real-valued number Quantity[xi,unit] a quantity with a unit Around[xi,ei] value xi with uncertainty ei Interval[{xmin,xmax}] values between xmin and xmax - If necessary, the data will be sorted according to the xi.
- The positive part of each datai is plotted on the positive axis and the negative part on the negative axis.
- Negative values of yi stack in the opposite direction from positive values.
- Values xi and yi that are not of the preceding form are taken to be missing and are not shown. Missing data is taken to be zero for accumulation purposes.
- The following wrappers w can be used for the datai:
-
Annotation[datai,label] provide an annotation for the data Button[datai,action] define an action to execute when the data is clicked Callout[datai,label] label the data with a callout Callout[datai,label,pos] place the callout at relative position pos EventHandler[datai,events] define a general event handler for the data Highlighted[datai,effect] dynamically highlight fi with an effect Highlighted[datai,Placed[effect,pos]] statically highlight fi with an effect at position pos Hyperlink[datai,uri] make the data a hyperlink Labeled[datai,label] label the data Labeled[datai,label,pos] place the label at relative position pos Legended[datai,label] identify the data in a legend PopupWindow[datai,cont] attach a popup window to the data StatusArea[datai,label] display in the status area on mouseover Style[datai,styles] show the data using the specified styles Tooltip[datai,label] attach a tooltip to the curve - Wrappers w can be applied at multiple levels:
-
{…,w[yi],…} wrap the value yi in data {…,w[{xi,yi}],…} wrap the point {xi,yi} w[datai] wrap the data w[{data1,…}] wrap a collection of datai w1[w2[…]] use nested wrappers - Callout, Labeled and Placed can use the following positions pos:
-
Automatic automatically placed labels Above, Below, Before, After positions around the curve x near the curve at a position x Scaled[s] scaled position s along the curve {s,Above},{s,Below},… relative position at position s along the curve {pos,epos} epos in label placed at relative position pos of the curve - StackedListPlot has the same options as Graphics, with the following additions and changes: [List of all options]
-
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 DataRange Automatic the range of x values to assume for data Filling Automatic filling under each line FillingStyle Automatic style to use for filling InterpolationOrder None the polynomial degree of curves used in joining data points IntervalMarkers Automatic how to render uncertainty IntervalMarkersStyle Automatic style for uncertainty elements LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels MaxPlotPoints Infinity the maximum number of points to include Mesh None how many mesh points to draw on each line MeshFunctions {#1&} how to determine the placement of mesh points MeshShading None how to shade regions between mesh points MeshStyle Automatic the style for mesh points Method Automatic methods to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotHighlighting Automatic highlighting effect for curves PlotLabel None overall label for the plot PlotLabels None labels for data PlotLayout "Stacked" how to position data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point 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 PlotTheme $PlotTheme overall theme for the plot ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the plot - DataRange determines how values {y1,…,yn} are interpreted into {{x1,y1},…,{xn,yn}}. Possible settings include:
-
Automatic,All uniform from 1 to n {xmin,xmax} uniform from xmin to xmax - In general, a list of pairs {{x1,y1},{x2,y2},…} is interpreted as a list of points, but the setting DataRangeAll forces it to be interpreted as multiple data sources {{y11,y12},{y21,y23},…}.
- LabelingFunction->f specifies that each point should have a label given by f[value,index,lbls], where value is the value associated with the point, index is its position in the data, and lbls is the list of relevant labels.
- The following settings for PlotLayout can be used to display multiple sets of data:
-
"Stacked" accumulate the data per axis "Percentile" accumulate and normalize the data per axis - Typical settings for PlotLegends include:
-
None no legend Automatic automatically determine legend {lbl1,lbl2,…} use lbl1, lbl2, … as legend labels Placed[lspec,…] specify placement for legend - ScalingFunctions->"scale" scales the coordinate; ScalingFunctions{"scalex","scaley"} scales both the and coordinates.
- Possible highlighting effects for Highlighted and PlotHighlighting include:
-
style highlight the indicated curve "Ball" highlight and label the indicated point in a curve "Dropline" highlight and label the indicated point in a curve with droplines to the axes "XSlice" highlight and label all points along a vertical slice "YSlice" highlight and label all points along a horizontal slice Placed[effect,pos] statically highlight the given position pos - Highlight position specifications pos include:
-
x, {x} effect at {x,y} with y chosen automatically {x,y} effect at {x,y} {pos1,pos2,…} multiple positions posi -
AlignmentPoint Center the default point in the graphic to align with AspectRatio 1/GoldenRatio ratio of height to width Axes True whether to draw axes AxesLabel None axes labels AxesOrigin Automatic where axes should cross AxesStyle {} style specifications for the axes Background None background color for the plot BaselinePosition Automatic how to align with a surrounding text baseline BaseStyle {} base style specifications for the graphic 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 ContentSelectable Automatic whether to allow contents to be selected CoordinatesToolOptions Automatic detailed behavior of the coordinates tool DataRange Automatic the range of x values to assume for data Epilog {} primitives rendered after the main plot Filling Automatic filling under each line FillingStyle Automatic style to use for filling FormatType TraditionalForm the default format type for text Frame False whether to put a frame around the plot FrameLabel None frame labels FrameStyle {} style specifications for the frame FrameTicks Automatic frame ticks FrameTicksStyle {} style specifications for frame ticks GridLines None grid lines to draw GridLinesStyle {} style specifications for grid lines ImageMargins 0. the margins to leave around the graphic ImagePadding All what extra padding to allow for labels etc. ImageSize Automatic the absolute size at which to render the graphic InterpolationOrder None the polynomial degree of curves used in joining data points IntervalMarkers Automatic how to render uncertainty IntervalMarkersStyle Automatic style for uncertainty elements LabelingFunction Automatic how to label points LabelingSize Automatic maximum size of callouts and labels LabelStyle {} style specifications for labels MaxPlotPoints Infinity the maximum number of points to include Mesh None how many mesh points to draw on each line MeshFunctions {#1&} how to determine the placement of mesh points MeshShading None how to shade regions between mesh points MeshStyle Automatic the style for mesh points Method Automatic methods to use PerformanceGoal $PerformanceGoal aspects of performance to try to optimize PlotHighlighting Automatic highlighting effect for curves PlotLabel None overall label for the plot PlotLabels None labels for data PlotLayout "Stacked" how to position data PlotLegends None legends for data PlotMarkers None markers to use to indicate each point PlotRange Automatic range of values to include PlotRangeClipping True whether to clip at the plot range PlotRangePadding Automatic how much to pad the range of values PlotRegion Automatic the final display region to be filled PlotStyle Automatic graphics directives to determine the style of each line PlotTheme $PlotTheme overall theme for the plot PreserveImageOptions Automatic whether to preserve image options when displaying new versions of the same graphic Prolog {} primitives rendered before the main plot RotateLabel True whether to rotate y labels on the frame ScalingFunctions None how to scale individual coordinates TargetUnits Automatic units to display in the plot Ticks Automatic axes ticks TicksStyle {} style specifications for axes ticks
List of all options
Examples
open allclose allBasic Examples (4)
Scope (29)
General Data (5)
Lines are constructed taking into account points in all datasets:
Missing values are taken to be zero:
Negative points are stacked in the opposite direction:
Change the layout to show data as percentiles:
Use ScalingFunctions to scale the axes:
Special Data (5)
Use Quantity to include units with the data:
Specify strings to use as labels:
Specify a location for labels:
Plot TimeSeries directly:
Data Wrappers (3)
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:
Labeling and Legending (10)
Label data sources with Labeled:
Specify the labels with PlotLabels:
Label data automatically with Callout:
Include legends for each curve:
Specify the maximum size of labels:
For dense sets of points, some labels may be turned into tooltips by default:
Increasing the size of the plot will show more labels:
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:
Options (61)
ClippingStyle (1)
DataRange (4)
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:
Filling (3)
FillingStyle (2)
Fill with red below the axis and with blue above:
Use a variable filling style obtained from ColorFunction:
InterpolationOrder (1)
IntervalMarkers (3)
IntervalMarkersStyle (2)
LabelingFunction (1)
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:
LabelingSize (4)
Mesh (1)
MeshFunctions (1)
MeshShading (1)
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 (1)
PlotHighlighting (7)
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 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:
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:
PlotLabels (5)
Specify text to label sets of points:
Place the labels above the points:
Use callouts to identify the datasets:
Label curves with the keys from an association:
Use None to not label a data source:
PlotLayout (1)
PlotLegends (1)
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:
Change the size of the default plot markers:
Use arbitrary text for plot markers:
Use explicit graphics for plot markers:
PlotRange (1)
PlotRange shows all data by default:
PlotStyle (4)
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:
PlotTheme (3)
ScalingFunctions (3)
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:
Text
Wolfram Research (2017), StackedListPlot, Wolfram Language function, https://reference.wolfram.com/language/ref/StackedListPlot.html (updated 2023).
CMS
Wolfram Language. 2017. "StackedListPlot." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2023. https://reference.wolfram.com/language/ref/StackedListPlot.html.
APA
Wolfram Language. (2017). StackedListPlot. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/StackedListPlot.html