Log axis when plotting holoviews object through datashader
See original GitHub issueWith the following code I’m trying to maintain the log scale of the x-axis which seems to work when using the pure holoview plot (top plot), but not when plotting the holoview.NdOverlay
object through the datashader (bottom plot).
import numpy as np
import holoviews as hv
import datashader as ds
from holoviews.operation.datashader import datashade, dynspread
hv.extension('bokeh')
%%opts NdOverlay [height=256 width=1024 show_grid=True logx=True]
%%opts RGB [height=256 width=1024 show_grid=True logx=True]
frequencies = [0.5, 0.75, 1.0, 1.25]
def sine_curve(phase, freq):
xvals = [0.1*i+.0001 for i in range(100)]
return hv.Curve((xvals, [np.sin(phase+freq*x) for x in xvals]))
overlay = hv.NdOverlay({f: sine_curve(0, f) for f in frequencies}, kdims='channel_keys')
curve_plot = dynspread(datashade(overlay, aggregator=ds.count_cat('channel_keys')))
(overlay + curve_plot).cols(1)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:10 (6 by maintainers)
Top Results From Across the Web
Log axis when plotting holoviews object through datashader
With the following code I'm trying to maintain the log scale of the x-axis which seems to work when using the pure holoview...
Read more >Customizing Plots — HoloViews v1.15.3
From there the hook can modify the objects in the plot's handles, ... main types of axes supported across plotting backends, standard linear...
Read more >Interactivity — Datashader v0.14.3
To get axes and interactivity, the images generated by Datashader need to be embedded into a plot using an external library like Matplotlib...
Read more >Lesson 34 High level plotting with HoloViews
Importantly, HoloViews provides convenient access to Datashader. ... That is, we want to make a plot where each glyph lies in a two-dimensional...
Read more >Customization — hvPlot 0.8.2 documentation
In addition to regular plot options hvplot also exposes options for dealing with ... and shading using datashader library returning an RGB object...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Just got bitten by this. Maybe in the interim it would make sense to throw a warning until a proper fix can be implemented? Right now, it fails silently and could mislead users into thinking they’re looking at the log scaled plot when they actually aren’t.
Yes, I agree. I don’t quite know how to detect this case cleanly, but if it’s obvious to anyone else, I’d be very happy to see a PR appear that warns or even raises an exception (given how unlikely it is that someone would find the current behavior useful or appropriate).