- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to use Font Awesome symbol as marker in matplotlib?
To use Font Awesome symbol as a marker, we can take the following steps −
- Set the figure size and adjust the padding between and around the subplots.
- Create a list of symbols; has to be plotted.
- Create x and y data points using numpy.
- Create a new figure or activate an existing figure using figure() method.
- Iterate the symbols and use it while plotting a line.
- To display the figure, use show() method.
Example
import numpy as np import matplotlib.pyplot as plt plt.rcParams["figure.figsize"] = [7.50, 3.50] plt.rcParams["figure.autolayout"] = True symbols = [u'\u2B21', u'\u263A', u'\u29C6', u'\u2B14', u'\u2B1A', u'\u25A6', u'\u229E', u'\u22A0', u'\u22A1', u'\u20DF'] x = np.arange(10) y = np.arange(10) plt.figure() for i, symbol in enumerate(symbols): y2 = y + 4*i plt.plot(x, y2, '.') for x0, y0 in zip(x, y2): plt.text(x0, y0, symbol, fontname='STIXGeneral', size=15, va='center', ha='center', clip_on=True) plt.show()
Output
- Related Articles
- How to use Font Awesome in Native Android Application?
- How to use Font Awesome in Native Android Application using Kotlin?
- How to use a custom png image marker in a plot (Matplotlib)?
- How to Adjust Marker Size in Matplotlib?
- How to use multiple font sizes in one label in Python Matplotlib?
- How to obtain the same font in Matplotlib output as in LaTex output?
- How to change the marker size with pandas.plot() in Matplotlib?
- How to set legend marker size and alpha in Matplotlib?
- How to increase plt.title font size in Matplotlib?
- How to get XKCD font working in Matplotlib?
- How to use small font in HTML?
- How to plot scatter points with increasing size of marker in Matplotlib?
- How to modify the font size in Matplotlib-venn?
- Is it possible to control Matplotlib marker orientation?
- How to plot two dotted lines and set marker using Matplotlib?

Advertisements