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]: Inconsistent y-axis unit label with plot/scatter #23416

Open
@dstansby

Description

@dstansby

Bug summary

When manually setting the units of an axis usingset_units, aplot will show an axis label, but ascatter won't.

The example needs to be run inexamples/units to have access to thebasic_units.py file.

Code for reproduction

frombasic_unitsimportcmimportmatplotlib.pyplotaspltimportnumpyasnpcms=cm*np.arange(0,10,2)fig,axs=plt.subplots(1,2,tight_layout=True)# Does create a y-axis labelaxs[0].yaxis.set_units(cm)axs[0].plot(np.arange(5),cms)# Does not create a y-axis labelaxs[1].yaxis.set_units(cm)axs[1].scatter(np.arange(5),cms)plt.show()

Actual outcome

broken

Expected outcome

When the units aren't explicitly set (commenting outset_units()), the output is as expected with both labels:
good

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.0.dev2669+gdc163ca442.d20220712

Matplotlib Backend

No response

Python version

No response

Jupyter version

No response

Installation

git checkout

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