Skip to content

set_rgrids() in a polar plot cannot set ticklabel size #17463

@AgilentGCMS

Description

@AgilentGCMS

Bug report

In a polar plot, I want to set the sizes of the r and theta ticklabels. While setting the theta ticklabel size works with the method set_thetagrids, setting the r ticklabel size with set_rgrids does not work.

As an aside, I find it confusing that some functions for setting theta parameters require arguments in radians (e.g., set_thetalim), while others require arguments in degrees (e.g., set_thetagrids).

Code snippet

from matplotlib import pyplot as plt
import numpy as np

fig = plt.figure()
ax = plt.axes(polar=True)
ax.set_thetalim(0., np.pi/4.)
ax.set_rlim(0., 2.)

# set the size of theta ticklabels (works)
thetatick_locs = np.linspace(0.,45.,4)
thetatick_labels = [u'%i\u00b0'%np.round(x) for x in thetatick_locs]
ax.set_thetagrids(thetatick_locs, thetatick_labels, fontsize=16)

# set the size of r ticklabels (does not work)
rtick_locs = np.arange(0.5,2.0,0.7)
rtick_labels = ['%.1f'%r for r in rtick_locs]
ax.set_rgrids(rtick_locs, rtick_labels, fontsize=16)

plt.show()

Actual outcome
See figure

Expected outcome
I expect to be able to set the font properties of r ticklabels. Other settings, such as trying to set the font weight, does not work either.

Matplotlib version

  • Operating system: Macos 10.15.4 (Catalina)
  • Matplotlib version: 3.2.1 (installed via macports)
  • Matplotlib backend: Qt5Agg
  • Python version: 3.8.2 (installed via macports)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy