Sankey Diagrams
I just updated matplotlib to 1.1 and want try the new features
and
Animation
but when I try the api example code: sankey_demo_basics.py
I got the error messages as below:
···
==============================================================================
Traceback (most recent call last):
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py”, line 884, in draw
func(*args)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py”, line 1983, in draw
a.draw(renderer)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py”, line 385, in draw
gc.set_linewidth(lw)
TypeError: a float is required
Traceback (most recent call last):
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/figure.py”, line 884, in draw
func(*args)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/axes.py”, line 1983, in draw
a.draw(renderer)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/artist.py”, line 55, in draw_wrapper
draw(artist, renderer, *args, **kwargs)
File “/Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py”, line 385, in draw
gc.set_linewidth(lw)
TypeError: a float is required
==================================================================================
Then I looked into the file /Library/Frameworks/EPD64.framework/Versions/7.2/lib/python2.7/site-packages/matplotlib/patches.py
at the line 384 the code is: gc.set_linewidth(lw)
I added “lw = np.float(lw)” before “gc.set_linewidth(lw)”, then the example code runs successfully.
Any help?
Thanks for any reply.
–
Mingkui Li