-
-
Notifications
You must be signed in to change notification settings - Fork 402
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
ignore nan in hist() #59
Comments
I think this is a reasonable feature request that should be fairly easy to implement. |
Fixed in a981515, let me know if it works for you so I can close this issue. |
Thanks for doing this! This works: z1.hist() But this doesn't In [6]:
z1.hist(bin_range=(1e-5, z1.data.max()))
Traceback (most recent call last):
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/holoviews/ipython/display_hooks.py", line 203, in wrapped
**kwargs)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/holoviews/ipython/display_hooks.py", line 279, in layout_display
return display_figure(fig)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/holoviews/ipython/display_hooks.py", line 168, in display_figure
figdata = renderer.figure_data(fig, figure_format)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/holoviews/plotting/__init__.py", line 252, in figure_data
fig.canvas.print_figure(bytes_io, **kw)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/backend_bases.py", line 2168, in print_figure
bbox = a.get_window_extent(renderer)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/patches.py", line 491, in get_window_extent
return self.get_path().get_extents(self.get_transform())
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/path.py", line 518, in get_extents
transform = transform.frozen()
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/transforms.py", line 2067, in frozen
return blended_transform_factory(self._x.frozen(), self._y.frozen())
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/transforms.py", line 2201, in blended_transform_factory
return BlendedAffine2D(x_transform, y_transform)
File "/home/bnijholt/python/env_stable/lib/python2.7/site-packages/matplotlib/transforms.py", line 2148, in __init__
assert y_transform.is_separable
AssertionError
Out[6]:
:AdjointLayout [AdjointLayout]
:Histogram [Band gap] (Frequency) |
Presumably that's because
Returns np.NaN, so I think that behavior is desired, you provided an invalid range so it will complain. It should probably complain long before it gets to plotting but if you want to do that then just use:
|
Yes, works like a charm 👍 |
I tried the example
on my own data, but
.hist()
doesn't handlenp.NaN
values.Is it possible to make it ignore these values?
The text was updated successfully, but these errors were encountered: