File tree Expand file tree Collapse file tree 1 file changed +16
-4
lines changed
examples/text_labels_and_annotations Expand file tree Collapse file tree 1 file changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -79,9 +79,21 @@ def print_text(text):
7979
8080#############################################################################
8181#
82- # Print all available fonts (this is OS specific):
82+ # Print all available font paths (this is OS specific):
8383
8484import matplotlib .font_manager
85- list_of_fonts = matplotlib .font_manager .findSystemFonts (fontpaths = None , fontext = 'ttf' )
86- for l in list_of_fonts :
87- print (l )
85+ fpaths = matplotlib .font_manager .findSystemFonts (fontpaths = None , fontext = 'ttf' )
86+ for i in fpaths :
87+ print (i )
88+
89+
90+ #############################################################################
91+ #
92+ # Print all available font names and their style (this is OS specific):
93+
94+ import matplotlib .font_manager
95+ fpaths = matplotlib .font_manager .findSystemFonts ()
96+
97+ for i in fpaths :
98+ f = matplotlib .font_manager .get_font (i )
99+ print (f"{ f .family_name = :<35} { f .style_name = } " )
You can’t perform that action at this time.
0 commit comments