8000 Merge pull request #13620 from timhoffm/example-watermark · matplotlib/matplotlib@7af52fe · GitHub
[go: up one dir, main page]

Skip to content

Commit 7af52fe

Browse files
authored
Merge pull request #13620 from timhoffm/example-watermark
Improve watermark example
2 parents 2c54229 + 4eafef2 commit 7af52fe

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

examples/text_labels_and_annotations/watermark_text.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Text watermark
44
==============
55
6-
Adding a text watermark.
6+
A watermark effect can be achieved by drawing a semi-transparent text.
77
"""
88
import numpy as np
99
import matplotlib.pyplot as plt
@@ -16,9 +16,9 @@
1616
ax.plot(np.random.rand(20), '-o', ms=20, lw=2, alpha=0.7, mfc='orange')
1717
ax.grid()
1818

19-
fig.text(0.95, 0.05, 'Property of MPL',
20-
fontsize=50, color='gray',
21-
ha='right', va='bottom', alpha=0.5)
19+
ax.text(0.5, 0.5, 'created with matplotlib', transform=ax.transAxes,
20+
fontsize=40, color='gray', alpha=0.5,
21+
ha='center', va='center', rotation='30')
2222

2323
plt.show()
2424

0 commit comments

Comments
 (0)
0