我最近更新到OS X Maverics并且作为其中一个结果它打破了我的python matplotlib 3D绘图。例如,当我运行时:
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
我明白了:
Traceback (most recent call last):
File "/Users/nacho/Documents/Proyecto/codigo/RLS/run_rls.py", line 89, in <module>
n_plot([bunch.ff_weighted_estimation_error for bunch in rls.rls_bunchs], 'Peso')
File "/Users/nacho/Documents/Proyecto/codigo/RLS/run_rls.py", line 43, in n_plot
ax = fig.gca(projection='3d')
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 1066, in gca
return self.add_subplot(111, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 789, in add_subplot
a = subplot_class_factory(projection_class)(self, *args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line 8457, in __init__
self._axes_class.__init__(self, fig, self.figbox, **kwargs)
File "/Library/Python/2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 91, in __init__
*args, **kwargs)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line 463, in __init__
self.cla()
File "/Library/Python/2.7/site-packages/mpl_toolkits/mplot3d/axes3d.py", line 1040, in cla
self.zaxis._set_scale('linear')
AttributeError: 'ZAxis' object has no attribute '_set_scale'
我正在运行Python 2.7.5和matplotlib 1.3.1。