« View all new features in
Mathematica
9
◄
previous
|
next
►
New in
Mathematica
9
›
Legends
Point 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]; Row[{PointLegend[88, labels, LegendMarkerSize -> {15, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], PointLegend[68, labels, LegendMarkers -> markers1, LegendMarkerSize -> {15, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], PointLegend["DarkRainbow", labels, LegendMarkers -> markers2, LegendMarkerSize -> {15, 15}, LabelStyle -> {GrayLevel[0.3], Bold, 16}], PointLegend[Table[Black, {7}], labels, LegendMarkerSize -> {15, 15}, LegendMarkers -> {{Automatic, 20}}, LabelStyle -> {GrayLevel[0.3], Bold, 16}]}, Spacer[10]]
Create point legends that match a plot in style and marker shape.
Out[1]=