Skip to content
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

logx, logy not applying when datashade=True #187

Open
ivirshup opened this issue Mar 17, 2019 · 8 comments
Open

logx, logy not applying when datashade=True #187

ivirshup opened this issue Mar 17, 2019 · 8 comments
Labels
type: bug Something isn't working type: upstream Anything that requires work outside hvPlot
Milestone

Comments

@ivirshup
Copy link
Contributor

When logx or logy is set it doesn't log the points positions if datashade=True, it just changes the scale on the axis. Here's an example for logx:

import pandas as pd
import numpy as np
import holoviews as hv

d = pd.DataFrame({
    "x": np.linspace(1, 100, 10000) + np.random.rand(10000),
    "y": np.linspace(1, 100, 10000) + np.random.rand(10000)
})

(   d.hvplot.scatter("x", "y", logx=True) 
 +  d.hvplot.scatter("x", "y", logx=True, datashade=True)).cols(1)

image

@poplarShift
Copy link

Just ran into the same thing, though I would add that on rescaling the log axis with the zoom tool, the points stick to the extents of the range and don't keep their values relative to that axis:

import pandas as pd
import numpy as np
import hvplot.pandas

df = pd.DataFrame(dict(x=np.arange(1,1000), y=np.arange(1,1000)+np.abs(np.random.randn(999))*100))
df.hvplot.scatter(logy=True)

@philippjfr
Copy link
Member

This is an issue in HoloViews already: holoviz/holoviews#2195 but once it's supported there we will have to fix it here as well.

@philippjfr philippjfr added the type: bug Something isn't working label Jul 17, 2019
@philippjfr philippjfr added this to the v0.6.1 milestone Jun 29, 2020
@philippjfr
Copy link
Member

I think we should just expose the axes options on the rasterize operation in HoloViews and since hvPlot can set the option on the operation and as a plot option we don't have the same issues in hvPlot that we have in HoloViews.

@philippjfr philippjfr removed this from the v0.6.1 milestone Jun 29, 2020
@philippjfr philippjfr added the type: upstream Anything that requires work outside hvPlot label Jun 29, 2020
@philippjfr philippjfr added this to the v0.7.0 milestone Jun 29, 2020
@philippjfr philippjfr modified the milestones: v0.7.0, 0.7.1 Jan 6, 2021
@philippjfr philippjfr modified the milestones: 0.7.1, 0.7.2, 0.8 May 21, 2021
@jlstevens jlstevens modified the milestones: 0.8, 0.81 Mar 7, 2022
@maximlt
Copy link
Member

maximlt commented Oct 11, 2022

Just ran into the same thing, though I would add that on rescaling the log axis with the zoom tool, the points stick to the extents of the range and don't keep their values relative to that axis:

I can't reproduce that so this must have been fixed upstream. The original issue is still there though.

I think we should just expose the axes options on the rasterize operation in HoloViews and since hvPlot can set the option on the operation and as a plot option we don't have the same issues in hvPlot that we have in HoloViews.

@philippjfr do you mean that the rasterize operation in HoloViews should havelogx and logy as new parameters (and maybe more axes parameters?)?

Also given that holoviz/holoviews#2195 is pretty old and hasn't seen any progress, what do you think about hvPlot raising an error when datashade=True in combination with logx/logy=True?

@jbednar
Copy link
Member

jbednar commented Oct 11, 2022

I may not remember all the details, but I don't believe that fixing it in hvplot requires solving the underlying HV issue. hvplot can do its own mapping from supplied arguments into arguments for the datashade and rasterize operations, and so it should be able to make this work in hvplot with minimal changes at the hv side (just ensuring that those operations do have the necessary arguments and do pass down their values into datashader). Fixing it in hv would require further mapping from hv options to datashade arguments, which is a much trickier proposition.

@maximlt
Copy link
Member

maximlt commented Oct 11, 2022

just ensuring that those operations do have the necessary arguments and do pass down their values into datashader

I think I would need more detailed guidance on this. @jlstevens maybe?

@jbednar
Copy link
Member

jbednar commented Oct 11, 2022

Yes, @jlstevens should be able to give some guidance. A quick check doesn't show any parameters already controlling logx and logy in rasterize or its parent classes AggregationOperation and ResamplingOperation, so those parameters would need to be added, probably to ResamplingOperation, and then passed down into the call to datashader. Once that support is in HoloViews, which seems straightforward, adding it to hvplot should be doable.

@maximlt maximlt modified the milestones: 0.8.2, 0.8.3 Nov 30, 2022
@KarateSnowMachine
Copy link

I think I have recently hit this bug where my raw datashader plots were not matching my hvplot plots and I could not figure out why. I am new to the whole stack so I was wondering -- I don't necessarily need interactivity like pan/zoom but I do want things like axes labels and legends for millions of datapoints. Is there a way to get those things by using a different API/layer of the stack?

@maximlt maximlt modified the milestones: 0.9.xx, next Sep 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working type: upstream Anything that requires work outside hvPlot
Projects
None yet
Development

No branches or pull requests

7 participants