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]: subplot_mosaic bug with empty_sentinel and sharey=True #25417

Open
@apicco

Description

@apicco

Bug summary

When an empty sentinel is used at the beginning of a row, with the sharey option True, the tick labelling on the y-axis isn't shown.

Code for reproduction

frommatplotlibimportpyplotaspltimportnumpyasnpdata= [np.array( [iforiinrange(100 ) ] ) ,np.random.random(100 ) ]fig1=plt.figure()# create a mosaic with an empty_sentinel# at the END of the row.# 'sharey=True' works.subplots=fig1.subplot_mosaic("""        AB.        CDE        """ ,sharex=True ,sharey=True )subplots["A" ].plot(data[0] ,data[1] )subplots["B" ].plot(data[0] ,data[1] )subplots["C" ].plot(data[0] ,data[1] )subplots["D" ].plot(data[0] ,data[1] )subplots["E" ].plot(data[0] ,data[1] )subplots["C" ].set_xlabel('A variable' )subplots["D" ].set_xlabel('A variable' )subplots["E" ].set_xlabel('A variable' )subplots["A" ].set_ylabel('Some data' )subplots["C" ].set_ylabel('Some data' )plt.savefig('mosaic_working.pdf' )# create a mosaic with an empty_sentinel# at the start of the row.# 'sharey=True' DOESN'T work: the y ticks# are missing.fig2=plt.figure()subplots=fig2.subplot_mosaic("""        .AB        CDE        """ ,sharey=True )subplots["A" ].plot(data[0] ,data[1] )subplots["B" ].plot(data[0] ,data[1] )subplots["C" ].plot(data[0] ,data[1] )subplots["D" ].plot(data[0] ,data[1] )subplots["E" ].plot(data[0] ,data[1] )subplots["C" ].set_xlabel('A variable' )subplots["D" ].set_xlabel('A variable' )subplots["E" ].set_xlabel('A variable' )subplots["A" ].set_ylabel('Some data' )subplots["C" ].set_ylabel('Some data' )plt.savefig('mosaic_not_working.pdf' )

Actual outcome

mosaic_working.pdf
mosaic_not_working.pdf

Expected outcome

The y-axis in the first subplot of the top row should have y ticks.

Additional information

No response

Operating system

OS

Matplotlib Version

3.7.0

Matplotlib Backend

No response

Python version

3.11

Jupyter version

No response

Installation

pip

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp