Skip to content

Commit b5b0cbb

Browse files
authored
adjust heading and remove second broken fontoverview example
1 parent ffdfa93 commit b5b0cbb

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

examples/text_labels_and_annotations/font_family_rc.py

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
2727
.. redirect-from:: /examples/font_family_rc_sgskip
2828
29-
First example, chooses default sans-serif font:
29+
###### First example, chooses default sans-serif font:
3030
"""
3131

3232
import matplotlib.pyplot as plt
@@ -45,7 +45,7 @@ def print_text(text):
4545

4646
#################################################################
4747
#
48-
# Second example:
48+
###### Second example:
4949

5050
plt.rcParams["font.family"] = "sans-serif"
5151
plt.rcParams["font.sans-serif"] = ["Nimbus Sans"]
@@ -54,22 +54,22 @@ def print_text(text):
5454

5555
#################################################################
5656
#
57-
# Third example:
57+
###### Third example:
5858

5959
plt.rcParams["font.family"] = "sans-serif"
6060
plt.rcParams["font.sans-serif"] = ["Humor Sans"]
6161
print_text("Hello World! 03")
6262

6363

6464
##################################################################
65-
# Fourth example, chooses default monospace font:
65+
###### Fourth example, chooses default monospace font:
6666

6767
plt.rcParams["font.family"] = "monospace"
6868
print_text("Hello World! 04")
6969

7070

7171
##################################################################
72-
# Fifth example:
72+
###### Fifth example:
7373

7474
plt.rcParams["font.family"] = "monospace"
7575
plt.rcParams["font.monospace"] = ["FreeMono"]
@@ -79,21 +79,9 @@ def print_text(text):
7979

8080
#############################################################################
8181
#
82-
# Print all available font paths (this is OS specific):
82+
###### Print all available font paths (this is OS specific):
8383

8484
import matplotlib.font_manager
8585
fpaths = matplotlib.font_manager.findSystemFonts(fontpaths=None, fontext='ttf')
8686
for i in fpaths:
8787
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 = }")

0 commit comments

Comments
 (0)