python: AttributeError: 'ZAxis' object has no attribute '_set_scale'

浪尽此生 提交于 2020-01-15 08:12:25

问题


I recently updated to OS X Maverics and as one of the results it broke my python matplotlib 3D plotting. For example when I run this:

import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

I get:

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'

I'm running Python 2.7.5, and matplotlib 1.3.1.

来源:https://stackoverflow.com/questions/19647836/python-attributeerror-zaxis-object-has-no-attribute-set-scale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!