You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I try to use a numpy float as the input of the matplotlib.pyplot.figaspect function, I get an error.
This is the code
import numpy as np
import matplotlib.pyplot as plt
aspect = np.float64(2) / np.float64(1)
# print aspect
w, h = plt.figaspect(aspect)
fig = plt.figure(figsize=(w,h))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8])
with the Error
/usr/local/lib/python2.7/dist-packages/matplotlib/figure.pyc in figaspect(arg)
1770 # Extract the aspect ratio of the array
1771 if isarray:
-> 1772 nr, nc = arg.shape[:2]
1773 arr_ratio = float(nr) / nc
1774 else:
ValueError: need more than 0 values to unpack
If I convert aspect to a float, it works ok
The text was updated successfully, but these errors were encountered:
/usr/local/lib/python2.7/dist-packages/matplotlib/figure.pyc in figaspect(arg)
1770 # Extract the aspect ratio of the array
1771 if isarray:
-> 1772 nr, nc = arg.shape[:2]
1773 arr_ratio = float(nr) / nc
1774 else:
ValueError: need more than 0 values to unpack
If I convert aspect to a float, it works ok
—
Reply to this email directly or view it on GitHub #5464.
mdboom
added this to the
Critical bugfix release (1.5.1) milestone
Nov 11, 2015
If I try to use a numpy float as the input of the
matplotlib.pyplot.figaspect
function, I get an error.This is the code
with the Error
If I convert
aspect
to afloat
, it works okThe text was updated successfully, but these errors were encountered: