« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Legends
Legend Point Markers
In[1]:=
X
d = {{14, 10, 19, 19, 15, 16, 21, 24}, {12, 17, 26, 31, 29, 38, 44, 48}, {15, 22, 36, 51, 51, 66, 68, 82}, {13, 22, 45, 67, 66, 79, 84, 98}}; markers = {{\!\(\* GraphicsBox[{ {GrayLevel[1], DiskBox[{0, 0}]}, {Thickness[0.1], CircleBox[{0, 0}]}}, ImagePadding->Automatic, ImageSize->20, PlotRangePadding->None]\), 0.04}, {\!\(\* GraphicsBox[{ {GrayLevel[1], RectangleBox[{0, 0}]}, {Thickness[0.1], LineBox[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}]}}, ImagePadding->Automatic, ImageSize->20, PlotRangePadding->None]\), 0.04}, {\!\(\* GraphicsBox[{ {GrayLevel[1], PolygonBox[{{0.5, 0}, {1, 0.5}, {0.5, 1}, {0, 0.5}}]}, {Thickness[0.1], LineBox[{{0.5, 0}, {1, 0.5}, {0.5, 1}, {0, 0.5}, {0.5, 0}}]}}, ImagePadding->Automatic, ImageSize->20, PlotRangePadding->None]\), 0.05}, {\!\(\* GraphicsBox[{ {GrayLevel[1], EdgeForm[None], PolygonBox[{{0, 0.067}, {1, 0.067}, {0.5, 0.933}}]}, {Thickness[0.1], LineBox[{{0, 0.067}, {1, 0.067}, {0.5, 0.933}, {0, 0.067}}]}}, ImagePadding->Automatic, ImageSize->20, PlotRangePadding->None]\), 0.04}};
Create a point legend that uses styles and point shapes to identify labels with data.
In[2]:=
X
ListLinePlot[d, PlotMarkers -> markers, PlotStyle -> (Directive[AbsoluteThickness[4], #] & /@ ColorData[64, "ColorList"]), ImageSize -> 400, Filling -> {1 -> {2}, 2 -> {3}, 3 -> {4}}, AxesOrigin -> {0, 0}, PlotLegends -> PointLegend[Row[{"l", #1}] & /@ Range[4], LegendMarkerSize -> 20, LabelStyle -> {GrayLevel[0.3], Bold, 16}]]
Out[2]=