FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
matplotlib/examples/api/watermark_image.py at master · cybertxt/matplotlib · GitHub
cybertxt
matplotlib
Repository navigation
Code
Pull requests
Actions
Projects
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
matplotlib
/
examples
/
api
/
watermark_image.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
21 lines (17 loc) · 506 Bytes
Breadcrumbs
matplotlib
/
examples
/
api
/
watermark_image.py
Copy path
File metadata and controls
21 lines (17 loc) · 506 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
"""
Use a PNG file as a watermark
"""
from
__future__
import
print_function
import
numpy
as
np
import
matplotlib
.
cbook
as
cbook
import
matplotlib
.
image
as
image
import
matplotlib
.
pyplot
as
plt
datafile
=
cbook
.
get_sample_data
(
'logo2.png'
,
asfileobj
=
False
)
print
(
'loading %s'
%
datafile
)
im
=
image
.
imread
(
datafile
)
im
[:, :,
-
1
]
=
0.5
# set the alpha channel
fig
,
ax
=
plt
.
subplots
()
ax
.
plot
(
np
.
random
.
rand
(
20
),
'-o'
,
ms
=
20
,
lw
=
2
,
alpha
=
0.7
,
mfc
=
'orange'
)
ax
.
grid
()
fig
.
figimage
(
im
,
10
,
10
)
plt
.
show
()
Back
|
FazBrowse Home
|
New Git URL