Skip to content

Problem passing 'norm' when plotting a faceted figure #1159

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jbusecke opened this issue Dec 8, 2016 · 3 comments · Fixed by #1160
Closed

Problem passing 'norm' when plotting a faceted figure #1159

jbusecke opened this issue Dec 8, 2016 · 3 comments · Fixed by #1160

Comments

@jbusecke
Copy link
Contributor

jbusecke commented Dec 8, 2016

I am not sure if this is a bug or user error by me.

I am basically trying to pass a SymLogNorm to all plots in a faceted plot, but it has no effect.
It works when I just plot a single axis.
Below I reproduced the effect with an example dataset.

Matplotlib version: 1.5.1
xarray version: 0.8.2

import xarray as xr
import matplotlib as mpl

# Here the passed 'norm=' keyword has the desired effect
da1 = xr.DataArray(np.random.exponential(size=[10,10]))

plt.figure()
da1.plot()

plt.figure()
da1.plot(norm=mpl.colors.SymLogNorm(0.1))


# In the faceted plot this has no effect
da2 = xr.DataArray(np.random.exponential(size=[10,10,4]))

plt.figure()
da.plot(x='dim_0',y='dim_1',col='dim_2',col_wrap=2)

plt.figure()
da.plot(x='dim_0',y='dim_1',col='dim_2',col_wrap=3,norm=mpl.colors.SymLogNorm(0.1))
@fmaussion
Copy link
Member

Yes, I think this is a bug. I have tried a fix in #1160

@fmaussion
Copy link
Member

Thanks for the report @jbusecke !

@jbusecke
Copy link
Contributor Author

jbusecke commented Dec 9, 2016

Thanks for the quick fix @fmauisson ! Much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants