Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Open
Milestone
Description
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