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 - 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 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:
-
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 LabelingFunction Automatic how to label points 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 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.
- 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
and
coordinates.
Examples
open allclose allSee Also
StackedDateListPlot ListLinePlot ListStepPlot DateListPlot BarChart PieChart Accumulate PlotLayout
Related Guides
Introduced in 2017
(11.2)