« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Legends
Match Curve Styles
In[1]:=
X
styles = Sequence @@ {ImageSize -> 400, Filling -> Axis, FillingStyle -> Opacity[0.1], PlotRange -> {0.01, All}, AxesOrigin -> {-0.01, 0.01}, PlotStyle -> (Directive[AbsoluteThickness[5], #] & /@ ColorData[68, "ColorList"])};
Curve styles are automatically matched when creating a plot legend.
In[2]:=
X
Plot[Table[ Sqrt[Cos[t]] Exp[-x Sin[t]^4], {x, {1, 10, 100, 1000, 10000}}] // Evaluate, {t, 0, Pi/2}, Evaluate@styles, PlotLegends -> LineLegend[{1, 10, 100, 1000, 10000}, LegendMarkerSize -> {30, 10}, LegendLabel -> x, LabelStyle -> {GrayLevel[0.3], Bold, 16}]]
Out[2]=