Python 使用matplotlib 2.0而不是matplotlib 1.5时的auto07p索引器错误

Python 使用matplotlib 2.0而不是matplotlib 1.5时的auto07p索引器错误,python,python-3.x,matplotlib,index-error,Python,Python 3.x,Matplotlib,Index Error,我最近正在努力使auto07p与matplotlib 2.0一起工作 可在此处找到源代码: 使用matplotlib 2.0(或任何大于1.5的版本)时,IndexError:标量变量的索引无效。出现: /home/ngb/auto/07p/python/Points.py:1086: VisibleDeprecationWarning: `rank` is deprecated; use the `ndim` attribute or function instead. To find th

我最近正在努力使auto07p与matplotlib 2.0一起工作

可在此处找到源代码:

使用matplotlib 2.0(或任何大于1.5的版本)时,IndexError:标量变量的索引无效。出现:

/home/ngb/auto/07p/python/Points.py:1086: VisibleDeprecationWarning: `rank` is deprecated; use the `ndim` attribute or function instead. To find the rank of a matrix see `numpy.linalg.matrix_rank`.
  r = rank(array_temp)
Created plot
<graphics.windowPlotter.WindowPlotter2D object at 0x7f9e42007710>
AUTO> Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python3.5/tkinter/__init__.py", line 1562, in __call__
    return self.func(*args)
  File "/usr/lib/python3.5/tkinter/__init__.py", line 608, in callit
    func(*args)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 370, in idle_draw
    self.draw()
  File "/home/ngb/auto/07p/python/graphics/grapher_mpl.py", line 92, in draw
    self.redraw()
  File "/home/ngb/auto/07p/python/graphics/grapher_mpl.py", line 65, in redraw
    FigureCanvasTkAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_tkagg.py", line 351, in draw
    FigureCanvasAgg.draw(self)
  File "/usr/lib/python3/dist-packages/matplotlib/backends/backend_agg.py", line 464, in draw
    self.figure.draw(self.renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 63, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/figure.py", line 1143, in draw
    renderer, self, dsu, self.suppressComposite)
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 63, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axes/_base.py", line 2409, in draw
    mimage._draw_list_compositing_images(renderer, self, dsu)
  File "/usr/lib/python3/dist-packages/matplotlib/image.py", line 139, in _draw_list_compositing_images
    a.draw(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/artist.py", line 63, in draw_wrapper
    draw(artist, renderer, *args, **kwargs)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 1136, in draw
    ticks_to_draw = self._update_ticks(renderer)
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 969, in _update_ticks
    tick_tups = [t for t in self.iter_ticks()]
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 969, in <listcomp>
    tick_tups = [t for t in self.iter_ticks()]
  File "/usr/lib/python3/dist-packages/matplotlib/axis.py", line 912, in iter_ticks
    majorLocs = self.major.locator()
  File "/usr/lib/python3/dist-packages/matplotlib/ticker.py", line 1794, in __call__
    return self.tick_values(vmin, vmax)
  File "/usr/lib/python3/dist-packages/matplotlib/ticker.py", line 1802, in tick_values
    locs = self._raw_ticks(vmin, vmax)
  File "/usr/lib/python3/dist-packages/matplotlib/ticker.py", line 1761, in _raw_ticks
    istep = np.nonzero(steps >= raw_step)[0][0]
IndexError: invalid index to scalar variable.

如果有人能在不更改matlibplot代码但仅更改自动代码的情况下帮助我处理错误,我将不胜感激。我已通读了密码,但没有发现任何可疑之处

我使用给定的公式和自动文件遇到了这个错误。但是,如果通常使用matplotlib 2.0和auto07p绘制大多数图形,如果缩放图形,很可能会出现此错误

我使用的文件如下所示:

把它们放在自动文件夹中。 自动运行。 和类型:

自动(“耦合器2.自动”)


谢谢。

为了得到这个错误,您运行的代码是什么?嘿,我使用给定的公式和自动文件遇到了这个错误。但是,如果您使用matplotlib 2.0和auto07p来绘制大多数图形,如果您放大图形,很可能会出现此错误。因此,只有在缩小图形时才会发生这种情况?我的观点是,由于错误发生在draw方法的运行时,因此没有很好的方法来追溯错误。相反,你需要从给定的代码中进行调试,这样你就可以从为人们提供最少的代码来重现错误中获益。您所说的代码是指来自auto的代码还是自动运行的我的代码?我在安装auto07p时遇到问题。所以我想我帮不了你。由于这是一个非常特殊的问题,您也可以尝试向auto07p的作者询问。
 def redraw(self):
        # recalculate label positions
        self.grapher.plotlabels()

        FigureCanvasTkAgg.draw(self)
def draw(self):
    ax = self.grapher.ax
    d = {}
    if ax is self.grapher.ax3d:
        [d["minx"], d["maxx"]] = ax.get_xlim3d()
        [d["miny"], d["maxy"]] = ax.get_ylim3d()
        [d["minz"], d["maxz"]] = ax.get_zlim3d()
        d["azimuth"] = ax.azim
        d["elevation"] = ax.elev
        d["cur_lims"] = Axes.get_xlim(ax), Axes.get_ylim(ax)
    else:
        [d["minx"], d["maxx"]] = ax.get_xlim()
        [d["miny"], d["maxy"]] = ax.get_ylim()
    for k in list(d):
        # don't adjust any unchanged settings
        if k == "cur_lims":
            if map(list, d[k]) == map(list, self.grapher._cur_lims):
                del d[k]
        elif d[k] == self.grapher.cget(k):
            del d[k]
    if d != {}:
        if "cur_lims" in d:
            del d["cur_lims"]
        if d != {}:
            self.grapher._configNoDraw(**d)

        self.redraw()
        return
    FigureCanvasTkAgg.draw(self)