我最近更新到 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。