Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d448de3

Browse files
authored
Merge pull request #21484 from Debilski/imread-docfix
Replacement for imread should return an array
2 parents fc69a38 + f507f98 commit d448de3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/image.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1463,7 +1463,7 @@ def imread(fname, format=None):
14631463
14641464
Passing a URL is deprecated. Please open the URL
14651465
for reading and pass the result to Pillow, e.g. with
1466-
``PIL.Image.open(urllib.request.urlopen(url))``.
1466+
``np.array(PIL.Image.open(urllib.request.urlopen(url)))``.
14671467
format : str, optional
14681468
The image file format assumed for reading the data. The image is
14691469
loaded as a PNG file if *format* is set to "png", if *fname* is a path
@@ -1519,7 +1519,7 @@ def imread(fname, format=None):
15191519
"deprecated since %(since)s and will no longer be supported "
15201520
"%(removal)s. Please open the URL for reading and pass the "
15211521
"result to Pillow, e.g. with "
1522-
"``PIL.Image.open(urllib.request.urlopen(url))``.")
1522+
"``np.array(PIL.Image.open(urllib.request.urlopen(url)))``.")
15231523
# hide imports to speed initial import on systems with slow linkers
15241524
from urllib import request
15251525
ssl_ctx = mpl._get_ssl_context()

0 commit comments

Comments
 (0)