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

Skip to content

Commit 551d9e9

Browse files
update example docstring of afm.py
In order for the example to work in python 3, the file needs to be read in binary mode: `open(afm_fname, 'rb')`
1 parent 3d929fc commit 551d9e9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/matplotlib/afm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
... 'fonts', 'afm', 'ptmr8a.afm')
2020
>>>
2121
>>> from matplotlib.afm import AFM
22-
>>> with open(afm_fname) as fh:
22+
>>> with open(afm_fname, 'rb') as fh:
2323
... afm = AFM(fh)
2424
>>> afm.string_width_height('What the heck?')
2525
(6220.0, 694)

0 commit comments

Comments
 (0)