« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Legends
Automatically Create Legends from Functions
In[1]:=
X
styleoptions = Sequence @@ {BaseStyle -> {GrayLevel[0.5], AbsoluteThickness[1.5]}, Filling -> Axis, FillingStyle -> {1 -> Opacity[0.6, Hue[0.63, 0.5, 0.7]], 2 -> Opacity[0.6, Hue[0.25, 1, 0.6]], 3 -> Opacity[0.6, Hue[0.11, 0.75, 0.9]]}, PlotStyle -> (Directive[AbsoluteThickness[5], #] & /@ {Hue[0.63, 0.5, 0.7], Hue[0.25, 1, 0.6], Hue[0.11, 0.75, 0.9]})};
Automatically use the formulas as legends in a plot.
In[2]:=
X
Plot[{Sin[x], Cos[x], Tan[x]}, {x, 0, 2 \[Pi]}, ImageSize -> 400, PlotLegends -> LineLegend["Expressions", LabelStyle -> {GrayLevel[0.3], Bold, 18}], Evaluate@styleoptions]
Out[2]=