I would like to create a plot where some of the points have a downward pointing arrow (see image below). In Astronomy this illustrates that the true value is actually lower than what's measured.Note that only some of the points have this symbol.
I would like to know how I can create such symbols in matplotlib. Are there downward arrow symbols that I can use?
Thanks for your help in advance!
We can add arrows to an annotation in Matplotlib by passing the arrowprops argument to the ax. annotate(~) method.
It is used both by the marker functionality of the plot and scatter. Render the string using mathtext. E.g “$r$” for marker showing the letter r. A list of (x, y) pairs used for Path vertices.
Sure.
When calling matplotlibs plot function, set a marker
caretdown
doesn't work for you, you can create your own marker by passing a list of (x,y) pairs, which are passed to a Path artist. x/y are 0…1 normalized coordinates that are scaled to the set marker size.Path
instance as a marker
, which allows even more flexibility.$…$
as a marker, where …
is arbitrary text, including Unicode characters, if your font supports it (should be the case these days). Downwards arrow in Unicode: ↓ (or \u2193
, resulting in $\u2193$
as the marker. Note that this must be a unicode string in Python 2.x [prepend u]). Unicode Block Arrows @ Wikipedia
Arrow
instance as marker, but I'm not sure whether that works.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With