10000 Merge pull request #25689 from timhoffm/watermark-example · matplotlib/matplotlib@d3f8864 · GitHub
[go: up one dir, main page]

Skip to content

Commit d3f8864

Browse files
authored
Merge pull request #25689 from timhoffm/watermark-example
Update watermark example
2 parents 39cdf5d + b18beae commit d3f8864

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

galleries/examples/images_contours_and_fields/watermark_image.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
Watermark image
44
===============
55
6-
Using a PNG file as a watermark.
6+
Overlay an image on a plot by moving it to the front (``zorder=3``) and making it
7+
semi-transparent (``alpha=0.7``).
78
"""
89

910
import matplotlib.pyplot as plt
@@ -17,9 +18,13 @@
1718

1819
fig, ax = plt.subplots()
1920

20-
ax.plot(np.sin(10 * np.linspace(0, 1)), '-o', ms=20, alpha=0.7, mfc='orange')
21+
np.random.seed(19680801)
22+
x = np.arange(30)
23+
y = x + np.random.randn(30)
24+
ax.bar(x, y, color='#6bbc6b')
2125
ax.grid()
22-
fig.figimage(im, 10, 10, zorder=3, alpha=.5)
26+
27+
fig.figimage(im, 25, 25, zorder=3, alpha=.7)
2328

2429
plt.show()
2530

-11 KB
Loading

0 commit comments

Comments
 (0)
0