Skip to content

Commit 0865176

Browse files
Doc: Markers update
1 parent 928d6d5 commit 0865176

39 files changed

+142
-75
lines changed

doc/_static/markers/m00.png

376 Bytes
Loading

doc/_static/markers/m01.png

226 Bytes
Loading

doc/_static/markers/m02.png

504 Bytes
Loading

doc/_static/markers/m03.png

411 Bytes
Loading

doc/_static/markers/m04.png

399 Bytes
Loading

doc/_static/markers/m05.png

422 Bytes
Loading

doc/_static/markers/m06.png

400 Bytes
Loading

doc/_static/markers/m07.png

394 Bytes
Loading

doc/_static/markers/m08.png

400 Bytes
Loading

doc/_static/markers/m09.png

395 Bytes
Loading

doc/_static/markers/m10.png

407 Bytes
Loading

doc/_static/markers/m11.png

356 Bytes
Loading

doc/_static/markers/m12.png

314 Bytes
Loading

doc/_static/markers/m13.png

492 Bytes
Loading

doc/_static/markers/m14.png

500 Bytes
Loading

doc/_static/markers/m15.png

448 Bytes
Loading

doc/_static/markers/m16.png

475 Bytes
Loading

doc/_static/markers/m17.png

349 Bytes
Loading

doc/_static/markers/m18.png

361 Bytes
Loading

doc/_static/markers/m19.png

366 Bytes
Loading

doc/_static/markers/m20.png

585 Bytes
Loading

doc/_static/markers/m21.png

264 Bytes
Loading

doc/_static/markers/m22.png

271 Bytes
Loading

doc/_static/markers/m23.png

415 Bytes
Loading

doc/_static/markers/m24.png

431 Bytes
Loading

doc/_static/markers/m25.png

270 Bytes
Loading

doc/_static/markers/m26.png

252 Bytes
Loading

doc/_static/markers/m27.png

254 Bytes
Loading

doc/_static/markers/m28.png

248 Bytes
Loading

doc/_static/markers/m29.png

417 Bytes
Loading

doc/_static/markers/m30.png

413 Bytes
Loading

doc/_static/markers/m31.png

416 Bytes
Loading

doc/_static/markers/m32.png

425 Bytes
Loading

doc/_static/markers/m33.png

420 Bytes
Loading

doc/_static/markers/m34.png

411 Bytes
Loading

doc/_static/markers/m35.png

418 Bytes
Loading

doc/_static/markers/m36.png

423 Bytes
Loading

doc/_static/markers/m37.png

483 Bytes
Loading

lib/matplotlib/markers.py

Lines changed: 142 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -5,82 +5,149 @@
55
66
All possible markers are defined here:
77
8-
============================== ===============================================
9-
marker description
10-
============================== ===============================================
11-
`"."` point
12-
`","` pixel
13-
`"o"` circle
14-
`"v"` triangle_down
15-
`"^"` triangle_up
16-
`"<"` triangle_left
17-
`">"` triangle_right
18-
`"1"` tri_down
19-
`"2"` tri_up
20-
`"3"` tri_left
21-
`"4"` tri_right
22-
`"8"` octagon
23-
`"s"` square
24-
`"p"` pentagon
25-
`"P"` plus (filled)
26-
`"*"` star
27-
`"h"` hexagon1
28-
`"H"` hexagon2
29-
`"+"` plus
30-
`"x"` x
31-
`"X"` x (filled)
32-
`"D"` diamond
33-
`"d"` thin_diamond
34-
`"|"` vline
35-
`"_"` hline
36-
TICKLEFT tickleft
37-
TICKRIGHT tickright
38-
TICKUP tickup
39-
TICKDOWN tickdown
40-
CARETLEFT caretleft (centered at tip)
41-
CARETRIGHT caretright (centered at tip)
42-
CARETUP caretup (centered at tip)
43-
CARETDOWN caretdown (centered at tip)
44-
CARETLEFTBASE caretleft (centered at base)
45-
CARETRIGHTBASE caretright (centered at base)
46-
CARETUPBASE caretup (centered at base)
47-
`"None"`, `" "` or `""` nothing
48-
``'$...$'`` render the string using mathtext.
49-
`verts` a list of (x, y) pairs used for Path vertices.
50-
The center of the marker is located at (0,0) and
51-
the size is normalized.
52-
path a `~matplotlib.path.Path` instance.
53-
(`numsides`, `style`, `angle`) The marker can also be a tuple (`numsides`,
54-
`style`, `angle`), which will create a custom,
55-
regular symbol.
56-
57-
`numsides`:
58-
the number of sides
59-
60-
`style`:
61-
the style of the regular symbol:
62-
63-
0
64-
a regular polygon
65-
1
66-
a star-like symbol
67-
2
68-
an asterisk
69-
3
70-
a circle (`numsides` and `angle` is
71-
ignored); deprecated.
72-
73-
`angle`:
74-
the angle of rotation of the symbol
75-
============================== ===============================================
76-
77-
For backward compatibility, the form (`verts`, 0) is also accepted, but it is
78-
deprecated and equivalent to just `verts` for giving a raw set of vertices that
79-
define the shape.
80-
81-
`None` is the default which means 'nothing', however this table is
8+
============================== ====== =========================================
9+
marker symbol description
10+
============================== ====== =========================================
11+
``"."`` |m00| point
12+
``","`` |m01| pixel
13+
``"o"`` |m02| circle
14+
``"v"`` |m03| triangle_down
15+
``"^"`` |m04| triangle_up
16+
``"<"`` |m05| triangle_left
17+
``">"`` |m06| triangle_right
18+
``"1"`` |m07| tri_down
19+
``"2"`` |m08| tri_up
20+
``"3"`` |m09| tri_left
21+
``"4"`` |m10| tri_right
22+
``"8"`` |m11| octagon
23+
``"s"`` |m12| square
24+
``"p"`` |m13| pentagon
25+
``"P"`` |m23| plus (filled)
26+
``"*"`` |m14| star
27+
``"h"`` |m15| hexagon1
28+
``"H"`` |m16| hexagon2
29+
``"+"`` |m17| plus
30+
``"x"`` |m18| x
31+
``"X"`` |m21| x (filled)
32+
``"D"`` |m19| diamond
33+
``"d"`` |m20| thin_diamond
34+
``"|"`` |m21| vline
35+
``"_"`` |m22| hline
36+
``0`` (``TICKLEFT``) |m25| tickleft
37+
``1`` (``TICKRIGHT``) |m26| tickright
38+
``2`` (``TICKUP``) |m27| tickup
39+
``3`` (``TICKDOWN``) |m28| tickdown
40+
``4`` (``CARETLEFT``) |m29| caretleft
41+
``5`` (``CARETRIGHT``) |m30| caretright
42+
``6`` (``CARETUP``) |m31| caretup
43+
``7`` (``CARETDOWN``) |m32| caretdown
44+
``8`` (``CARETLEFTBASE``) |m33| caretleft (centered at base)
45+
``9`` (``CARETRIGHTBASE``) |m34| caretright (centered at base)
46+
``10`` (``CARETUPBASE``) |m35| caretup (centered at base)
47+
``11`` (``CARETDOWNBASE``) |m36| caretdown (centered at base)
48+
``"None"``, ``" "`` or ``""`` nothing
49+
``'$...$'`` |m37| Render the string using mathtext.
50+
E.g ``"$f$"`` for marker showing the
51+
letter ``f``.
52+
``verts`` A list of (x, y) pairs used for Path
53+
vertices. The center of the marker is
54+
located at (0,0) and the size is
55+
normalized, such that the created path
56+
is encapsulated inside the unit cell.
57+
path A `~matplotlib.path.Path` instance.
58+
``(numsides, style, angle)`` The marker can also be a tuple
59+
``(numsides, style, angle)``, which
60+
will create a custom, regular symbol.
61+
62+
``numsides``:
63+
the number of sides
64+
65+
``style``:
66+
the style of the regular symbol:
67+
68+
+---+-----------------------------+
69+
| 0 | a regular polygon |
70+
+---+-----------------------------+
71+
| 1 | a star-like symbol |
72+
+---+-----------------------------+
73+
| 2 | an asterisk |
74+
+---+-----------------------------+
75+
| 3 | a circle (``numsides`` and |
76+
| | ``angle`` is ignored); |
77+
| | deprecated. |
78+
+---+-----------------------------+
79+
80+
``angle``:
81+
the angle of rotation of the symbol
82+
============================== ====== =========================================
83+
84+
For backward compatibility, the form ``(verts, 0)`` is also accepted, but it is
85+
deprecated and equivalent to just ``verts`` for giving a raw set of vertices
86+
that define the shape.
87+
88+
``None`` is the default which means 'nothing', however this table is
8289
referred to from other docs for the valid inputs from marker inputs and in
83-
those cases `None` still means 'default'.
90+
those cases ``None`` still means 'default'.
91+
92+
Note that special symbols can be defined via the
93+
:doc:`STIX math font </tutorials/text/mathtext>`,
94+
e.g. ``"$\u266B$"``. For an overview over the STIX font symbols refer to the
95+
`STIX font table <http://www.stixfonts.org/allGlyphs.html>`_.
96+
Also see the :doc:`/gallery/text_labels_and_annotations/stix_fonts_demo`.
97+
98+
Integer numbers from ``0`` to ``11`` create lines and triangles. Those are
99+
equally accessible via capitalied variables, like ``CARETDOWNBASE``.
100+
Hence the following are equivalent::
101+
102+
plt.plot([1,2,3], marker=11)
103+
plt.plot([1,2,3], marker=marker=matplotlib.markers.CARETDOWNBASE)
104+
105+
106+
Examples showing the use of markers:
107+
108+
* :doc:`/gallery/lines_bars_and_markers/marker_reference`
109+
* :doc:`/gallery/lines_bars_and_markers/marker_fillstyle_reference`
110+
* :doc:`/gallery/shapes_and_collections/marker_path`
111+
112+
113+
.. |m00| image:: /_static/markers/m00.png
114+
.. |m01| image:: /_static/markers/m01.png
115+
.. |m02| image:: /_static/markers/m02.png
116+
.. |m03| image:: /_static/markers/m03.png
117+
.. |m04| image:: /_static/markers/m04.png
118+
.. |m05| image:: /_static/markers/m05.png
119+
.. |m06| image:: /_static/markers/m06.png
120+
.. |m07| image:: /_static/markers/m07.png
121+
.. |m08| image:: /_static/markers/m08.png
122+
.. |m09| image:: /_static/markers/m09.png
123+
.. |m10| image:: /_static/markers/m10.png
124+
.. |m11| image:: /_static/markers/m11.png
125+
.. |m12| image:: /_static/markers/m12.png
126+
.. |m13| image:: /_static/markers/m13.png
127+
.. |m14| image:: /_static/markers/m14.png
128+
.. |m15| image:: /_static/markers/m15.png
129+
.. |m16| image:: /_static/markers/m16.png
130+
.. |m17| image:: /_static/markers/m17.png
131+
.. |m18| image:: /_static/markers/m18.png
132+
.. |m19| image:: /_static/markers/m19.png
133+
.. |m20| image:: /_static/markers/m20.png
134+
.. |m21| image:: /_static/markers/m21.png
135+
.. |m22| image:: /_static/markers/m22.png
136+
.. |m23| image:: /_static/markers/m23.png
137+
.. |m24| image:: /_static/markers/m24.png
138+
.. |m25| image:: /_static/markers/m25.png
139+
.. |m26| image:: /_static/markers/m26.png
140+
.. |m27| image:: /_static/markers/m27.png
141+
.. |m28| image:: /_static/markers/m28.png
142+
.. |m29| image:: /_static/markers/m29.png
143+
.. |m30| image:: /_static/markers/m30.png
144+
.. |m31| image:: /_static/markers/m31.png
145+
.. |m32| image:: /_static/markers/m32.png
146+
.. |m33| image:: /_static/markers/m33.png
147+
.. |m34| image:: /_static/markers/m34.png
148+
.. |m35| image:: /_static/markers/m35.png
149+
.. |m36| image:: /_static/markers/m36.png
150+
.. |m37| image:: /_static/markers/m37.png
84151
"""
85152

86153
from collections import Sized

0 commit comments

Comments
 (0)