Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
How to get a list of all the fonts currently available for Matplotlib?
To get a list of all the fonts currently available for matplotlib, we can use the font_manager.findSystemFonts() method.
Steps
Print a statement.
Use font_manager.findSystemFonts() method to get a list of fonts availabe.
Example
from matplotlib import font_manager
print("List of all fonts currently available in the matplotlib:<br>")
print(*font_manager.findSystemFonts(fontpaths=None, fontext='ttf'), sep="<br>")
Output
/usr/share/fonts/truetype/Nakula/nakula.ttf /usr/share/fonts/truetype/ubuntu/Ubuntu-L.ttf /usr/share/fonts/truetype/tlwg/Loma-BoldOblique.ttf ................................................................. ............................................................................ ................................................................................. ........ /usr/share/fonts/truetype/lohit-malayalam/Lohit-Malayalam.ttf /usr/share/fonts/truetype/tlwg/TlwgTypist-Oblique.ttf /usr/share/fonts/truetype/liberation2/LiberationMono-Bold.ttf
Advertisements
