Thanks to visit codestin.com
Credit goes to github.com

Skip to content

pyplot.rgrids don't do anything #16982

@Toussaic

Description

@Toussaic

Hello,

The function pyplot.rgrids doesn't seem to do anything.
I tried in an ipython console with the Qt5 backend and in a notebook.

import matplotlib.pyplot as plt
%matplotlib qt5
# Or in a notebook
# %matplotlib notebook

# Data
import random
import math
theta = [2*i*math.pi/360 for i in range(0, 360)]
r = [2 + random.gauss(0, 0.3) for i in range(0,360)]

# Plotting
plt.subplots(1, 1, subplot_kw={'projection':'polar'})
plt.plot(theta, r)
plt.rgrids(radii=(0.5, 2), labels=("low", "mean"))

On the other hand, when using axes.set_rgrids, it works fine :

# Instead of plt.rgrids
plt.gca().set_rgrids(radii=(0.5, 2), labels=("low", "mean"))

I tried using pyplot.draw() after, or defining the rgrids before plotting but it doesn't change anything.

Matplotlib version

  • Operating system: Windows 10
  • Matplotlib version: 3.1.3
  • Matplotlib backend : Qt5 or notebook
  • Python version: 3.8.1
  • Jupyter version : 6.0.3
  • Installed via conda

package_list.txt

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions