You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A hexbar with marginals=True has independent norms on the hexbins and the hbar and vbar unless vmin/vmax is set manually.
However, if the a changed signal is called, the behavior changes, and vmin/vmax is updated on the hbar and vbar to be equal to the vmin/vmax on main.
Aditionally, there is a bug so that the
Code for reproduction
# based on test_axes.py -- test_hexbin_linear()importmatplotlib.pyplotaspltimportnumpyasnpnp.random.seed(19680801)
n=100000x=np.random.standard_normal(n)
y=2.0+3.0*x+4.0*np.random.standard_normal(n)
fig, axes=plt.subplots(2, 1, figsize=(9, 9))
cs=axes[0].hexbin(x, y, gridsize=(10, 5), marginals=True,
reduce_C_function=np.sum)
fig.colorbar(cs.hbar).set_label('hbar')
fig.colorbar(cs.vbar).set_label('vbar')
fig.colorbar(cs).set_label('main')
cs=axes[1].hexbin(x, y, gridsize=(10, 5), marginals=True,
reduce_C_function=np.sum)
cs.set_cmap('rainbow')
fig.colorbar(cs.hbar).set_label('hbar')
fig.colorbar(cs.vbar).set_label('vbar')
fig.colorbar(cs).set_label('main')
Actual outcome
Only two of three colorbars change, and the limits are changed on the vbar.
Expected outcome
All three colorbars in the lower plot should change, but the limits should not update
Additional information
This bug came up as I was looking at this code in relation to the new data→color pipeline suggested in #28428.
I can find no report on this bug by actual users, so I don't think it needs a quick resolution.
where hbar and vbar is used in the wrong order.
However, only updating this will not resolve the issue where changing the colorbar changes the limits on the hbar and vbar in the case where these limits have not been set.
Operating system
No response
Matplotlib Version
3.8.2, matplotlib-dev
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered:
Bug summary
A hexbar with
marginals=True
has independent norms on the hexbins and the hbar and vbar unless vmin/vmax is set manually.However, if the a changed signal is called, the behavior changes, and vmin/vmax is updated on the hbar and vbar to be equal to the vmin/vmax on main.
Aditionally, there is a bug so that the
Code for reproduction
Actual outcome
Only two of three colorbars change, and the limits are changed on the vbar.
Expected outcome
All three colorbars in the lower plot should change, but the limits should not update
Additional information
This bug came up as I was looking at this code in relation to the new
data→color
pipeline suggested in #28428.I can find no report on this bug by actual users, so I don't think it needs a quick resolution.
data→color
pipeline discussed in VectorMappable with data type objects #28428 is approved, this bug will be resolved as part of this.data→color
pipeline is not approved, a small bugfix for this issue could be made (good first issue?)The relevant code is in _axes.py, in the function
hexbin()
which includeswhere
hbar
andvbar
is used in the wrong order.However, only updating this will not resolve the issue where changing the colorbar changes the limits on the hbar and vbar in the case where these limits have not been set.
Operating system
No response
Matplotlib Version
3.8.2, matplotlib-dev
Matplotlib Backend
No response
Python version
No response
Jupyter version
No response
Installation
git checkout
The text was updated successfully, but these errors were encountered: