Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Bug]: Can't obviously control radial ticks on polar plot #22104

Open
@robbiemallett

Description

@robbiemallett

Bug summary

The fontsize argument of ax.set_xticklabels() controls the size of azimuthal tick labels on a polar plot.
However the same argument, when passed to set_yticklabels(), does not control the size of radial tick labels. In fact it does nothing - the value of the argument has no impact on the plot.
To modify the size of radial tick labels, one must call: ax.yaxis.set_tick_params(labelsize='large')
This is not obvious.

Code for reproduction

importmatplotlib.pyplotaspltimportnumpyasnp# Make fake datad=np.random.rand(11,18)azimuths=np.radians(np.arange(-42.5,42.6,5))radials=np.linspace(1.3,3.9,11)r,theta=np.meshgrid(radials,azimuths)# Plot the datafig=plt.figure(figsize=(6,6))ax1=fig.add_subplot(111,polar=True)cont=ax1.contourf(theta,r,np.fliplr(d).T,                   )ax1.set_theta_zero_location('N')ax1.set_thetamin(-45)ax1.set_thetamax(45)ax1.set_xticks(np.arange(np.radians(-45),np.radians(46),np.radians(15),                       ))# Less radial ticksax1.set_xticklabels(np.arange(-45,46,15)[::-1],fontsize='xx-large',# This argument controls azimuthal tick labels                   )ax1.set_yticklabels(np.arange(-45,46,15)[::-1],fontsize='xx-large',# So why does this not control the radial tick labels?                   )# ax1.yaxis.set_tick_params(labelsize='xx-large')      # Especially when this line *does* control themplt.show()

Actual outcome

Here you can see that the radial tick labels are too small, unaffected by the set_yticklabels command:

download

Expected outcome

They should be this size. The following is produced by using the set_tick_params command:

download

Additional information

No response

Operating system

Ubuntu 18.04

Matplotlib Version

This occurs with matplotlib v3.3.4

Matplotlib Backend

inline

Python version

3.7.10

Jupyter version

6.4.6

Installation

conda

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp