Skip to content

Using of ax.set_ylim() for polar plot leads to "posx and posy should be finite values" error #11202

Closed
@ussserrr

Description

@ussserrr

Bug report

Bug summary

I trying to run my 1-year-old polar plot (made with matplotlib 2.0.0) but with current 2.2.2 version get "posx and posy should be finite values" error. I found out that the error is caused by the ax.set_ylim() method. Such way to manage the axis I've got from this SO question/answer. So this case looks like broken compatibility with older scripts.

Code for reproduction

import numpy as np
import matplotlib.pyplot as plt

fig = plt.figure(dpi=120)

ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True)

ax.set_theta_zero_location('N')
ax.set_theta_direction(-1)  # anti-clockwise

ax.set_ylim(90, -45)
ax.set_yticks(np.arange(-45, 90+0.1, 15))

plt.show()

Actual outcome

 ⌘  python3 bug_test.py
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
/Users/chufyrev/.local/share/virtualenvs/test-TGICRGwR/lib/python3.6/site-packages/numpy/core/_methods.py:29: RuntimeWarning: invali
d value encountered in reduce
  return umr_minimum(a, axis, None, out, keepdims)
/Users/chufyrev/.local/share/virtualenvs/test-TGICRGwR/lib/python3.6/site-packages/numpy/core/_methods.py:26: RuntimeWarning: invali
d value encountered in reduce
  return umr_maximum(a, axis, None, out, keepdims)
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values
posx and posy should be finite values

Matplotlib version

  • Operating system: macOS High Sierra 10.13.4
  • Matplotlib version: 2.2.2
  • Matplotlib backend (print(matplotlib.get_backend())): PyQt5
  • Python version: 3.6.5
  • Other libraries: numpy@1.14.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions