IndexError: invalid index to scalar variable. in /matplotlib/

Dear Sir or Madam,

I recently posted a bug report on the GitHub discussion page.

I am recently working on updating auto07p to work with matplotlib 2.0.
auto07p is software written for ordinary differential equations.
I encountered the 'IndexError: invalid index to scalar variable.' in

It appeared that the
istep = np.nonzero(steps >= raw_step)[0][0]
was trying to access a 1D array without checking its array dimension.

I replaced the line in
istep = np.nonzero(steps >= raw_step)[0][0]

With the following:
arr_dim = np.nonzero(steps >= raw_step).ndim
if arr_dim == 1:

istep = np.nonzero(steps >= raw_step)[0]

elif arr_dim == 2:

istep = np.nonzero(steps >= raw_step)[0][0]

It worked after the above changes. However, I am not absolutely sure
correctness of this fix.

May I suggest the developers look further into this issue and resolve this
in the future release?

Kind regards,

Mike Lee
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>