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
Description
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
Expected outcome
When the units aren't explicitly set (commenting outset_units()
), the output is as expected with both labels:
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