« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Legends
Curve Legends
In[1]:=
X
markers1 = {{\!\(\* GraphicsBox[ {EdgeForm[None], {GrayLevel[1], DiskBox[{0, 0}]}, {Thickness[0.1], CircleBox[{0, 0}]}}, ImageSize->15]\), 0.06}, {\!\(\* GraphicsBox[ {EdgeForm[None], {GrayLevel[1], RectangleBox[{0, 0}]}, {Thickness[0.1], LineBox[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}]}}, ImageSize->15]\), 0.06}, {\!\(\* GraphicsBox[ {EdgeForm[None], {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}}]}}, ImageSize->15]\), 0.07}, {\!\(\* GraphicsBox[ {EdgeForm[None], {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}}]}}, ImageSize->15]\), 0.07}, {\!\(\* GraphicsBox[ {EdgeForm[None], {Opacity[0], EdgeForm[None], RectangleBox[{0, 0}, {1, 1.2}]}, {GrayLevel[1], PolygonBox[{{0, 0.933}, {1, 0.933}, {0.5, 0.067}}]}, {Thickness[0.1], LineBox[{{0, 0.933}, {1, 0.933}, {0.5, 0.067}, {0, 0.933}}]}}, ImageSize->15]\), 0.07}}; markers2 = {{\!\(\* GraphicsBox[ {EdgeForm[None], {GrayLevel[1], DiskBox[{0, 0}]}, DiskBox[{0, 0}, 1, NCache[{Rational[1, 2] Pi, Rational[-1, 2] Pi}, { 1.5707963267948966`, -1.5707963267948966`}]], {Thickness[0.1], CircleBox[{0, 0}]}}, ImageSize->15]\), 0.06}, {\!\(\* GraphicsBox[ {EdgeForm[None], {GrayLevel[1], RectangleBox[{0, 0}]}, PolygonBox[{{0, 0}, {1, 0}, {1, 1}}], {Thickness[0.1], LineBox[{{0, 0}, {1, 0}, {1, 1}, {0, 1}, {0, 0}}]}}, ImageSize->15]\), 0.06}, {\!\(\* GraphicsBox[ {EdgeForm[None], {GrayLevel[1], PolygonBox[{{0.5, 0}, {1, 0.5}, {0.5, 1}, {0, 0.5}}]}, PolygonBox[{{0.5, 0}, {1, 0.5}, {0.5, 1}}], {Thickness[0.1], LineBox[{{0.5, 0}, {1, 0.5}, {0.5, 1}, {0, 0.5}, {0.5, 0}}]}}, ImageSize->15]\), 0.07}, {\!\(\* GraphicsBox[ {EdgeForm[None], {Opacity[0], RectangleBox[{0, -0.1}, {1, 1}]}, {Opacity[0], RectangleBox[{0, -0.1}, {1, 1}]}, {GrayLevel[1], PolygonBox[{{0, 0.067}, {1, 0.067}, {0.5, 0.933}}]}, PolygonBox[{{0.5, 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}}]}}, ImageSize->15]\), 0.07}, {\!\(\* GraphicsBox[ {EdgeForm[None], {Opacity[0], RectangleBox[{0, 0}, {1, 1.2}]}, {GrayLevel[1], PolygonBox[{{0, 0.933}, {1, 0.933}, {0.5, 0.067}}]}, PolygonBox[{{0.5, 0.933}, {1, 0.933}, {0.5, 0.067}}], {Thickness[0.1], LineBox[{{0, 0.933}, {1, 0.933}, {0.5, 0.067}, {0, 0.933}}]}}, ImageSize->15]\), 0.07}}; labels = Array[Row[{"lbl ", #1}] &, 7]; dashes = {{}, Dashed, Dotted, DotDashed, Dashing[{Large, Small, Tiny, Small}], Dashing[{Medium, Small, Small, Small}], Dashing[{Small, Tiny, 0, Tiny, Small}]}; Row[{LineLegend[ Table[Directive[ColorData[88][i], AbsoluteThickness[3]], {i, 7}], labels, LegendMarkerSize -> {25, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], LineLegend[68, labels, LegendMarkers -> markers1, LegendMarkerSize -> {25, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], LineLegend["DarkRainbow", labels, LegendMarkers -> markers2, LegendMarkerSize -> {25, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], LineLegend[Table[Directive[Black, dashes[[i]]], {i, 7}], labels, LegendMarkerSize -> {50, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}]}, Spacer[10]]
Create curve legends that match a plot in color, thickness, dashing, and marker shape.
Out[1]=