April 2018
Beginner to intermediate
300 pages
7h 34m
English
Matplotlib supports the use of custom characters as markers, which now include mathtext and emoji. To use characters as custom markers, we concatenate two dollar signs '$', each in front of and behind the character, and we pass them as the marker parameter. The notations starting with a backslash '\', such as '\clubsuit', are in mathtext, which will be introduced later in this chapter (in the text and annotations section).
Here is an example of a scatter plot of markers in mathematical symbols and an emoji:
import matplotlib.pyplot as pltfrom matplotlib.lines import Line2Dcustom_markers = ['$'+x+'$' for x in ['\$','\%','\clubsuit','\sigma','']]for i,marker in enumerate(custom_markers): plt.scatter(i%10,i,marker=marker,s=500) ...
Read now
Unlock full access