question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Log axis when plotting holoviews object through datashader

See original GitHub issue

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 plot (top plot), but not when plotting the holoview.NdOverlay object through the datashader (bottom plot).

bokeh_plot 2

bokeh_plot 3

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:open
  • Created 6 years ago
  • Reactions:1
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
wmaynercommented, Nov 5, 2019

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.

0reactions
jbednarcommented, Nov 5, 2019

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found