Skip to content

Commit f49ff66

Browse files
authored
Merge pull request #8211 from NelleV/MEP12_text_labels_and_annotations
Mep12 text labels and annotations
2 parents 2cf8d1e + 565a05b commit f49ff66

File tree

2 files changed

+15
-3
lines changed

2 files changed

+15
-3
lines changed

examples/text_labels_and_annotations/autowrap_demo.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
"""
2-
Auto-wrapping text demo.
2+
==================
3+
Auto-wrapping text
4+
==================
5+
6+
Matplotlib can wrap text automatically, but if it's too long, the text will be
7+
displayed slightly outside of the boundaries of the axis anyways.
38
"""
9+
410
import matplotlib.pyplot as plt
511

612
fig = plt.figure()
@@ -12,7 +18,7 @@
1218
plt.text(6, 5, t, ha='left', rotation=15, wrap=True)
1319
plt.text(5, 5, t, ha='right', rotation=-15, wrap=True)
1420
plt.text(5, 10, t, fontsize=18, style='oblique', ha='center',
15-
va='top', wrap=True)
21+
va='top', wrap=True)
1622
plt.text(3, 4, t, family='serif', style='italic', ha='right', wrap=True)
1723
plt.text(-1, 0, t, ha='left', rotation=-15, wrap=True)
1824

examples/text_labels_and_annotations/text_demo_fontdict.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
"""
2-
Demo using fontdict to control style of text and labels.
2+
=======================================================
3+
Controlling style of text and labels using a dictionary
4+
=======================================================
5+
6+
This example shows how to share parameters across many text objects and labels
7+
by creating a dictionary of options passed across several functions.
38
"""
9+
410
import numpy as np
511
import matplotlib.pyplot as plt
612

0 commit comments

Comments
 (0)