8000 Update watermark example · matplotlib/matplotlib@b18beae · GitHub
[go: up one dir, main page]

Skip to content

Commit b18beae

Browse files
committed
Update watermark example
Note: this replaces mpl-data/sample_data/logo2.png with the current logo. I think that's ok and we do not guarantee content stability of that data (internally, it's only used for the watermark example). But we could also add it as logo3.png at the cost of having 22kB more data.
1 parent b86ebba commit b18beae

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