-
-
Notifications
You must be signed in to change notification settings - Fork 404
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
Datashader min_alpha not in Holoviews #2108
Comments
Thanks for reporting this. We should expose as much functionality from datashader as we can so I'm assigning this issue to the next milestone. I don't expect it will take too much effort to support. @philippjfr Can you confirm that there is no easy way to set |
Yes, I have read through the datashader.py script and at some point it transforms the RGBA to RGB (as I understood), therefore, there isn't any alpha or min_alpha parameter to optimize. Which practically means that the plot is the same as the equivalent to using datashader with min_alpha = 0. I have also tried different things, but nothing solved the problem. Thank you for your time |
Right; this is an omission from |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Hi, I am new both at Holoviews and Datashader. But I tried to get the same plot that I get using datashader using Holoviews but it is being impossible because the datashade function does not have this min_alpha parameter that is present if I only use datashader function tf.shade.
It is important, since as I zoom in I get only a few bins really intense which mask almost the rest of the image.
Thank you
Code in datashader (part of if):
background = "black"
export = partial(export_image, export_path="export", background=background)
cm = partial(colormap_select, reverse=(background=="black"))
def create_image(x_range, y_range, w=plot_width, h=plot_height):
cvs = ds.Canvas(plot_width=w, plot_height=h, x_range=x_range, y_range=y_range)
agg = cvs.points(data, 'X_coordinate', 'Y_coordinate', ds.count_cat("Gene"))
img = tf.shade(agg, how = "eq_hist", min_alpha = 255)
spread = tf.dynspread(img, threshold = 0.1, max_px = 1, how="over")
return spread
p = base_plot(background_fill_color=background)
export(create_image(*data_smFISH_coords),"5_smFISH")
InteractiveImage(p, create_image)
Code using Holoviews ():
import numpy as np
import holoviews as hv
import datashader as ds
from holoviews.operation.datashader import aggregate, datashade, dynspread, shade
hv.notebook_extension('bokeh')
dynspread.max_px=1
dynspread.threshold=0.5
shade.cmap="#30a2da" # to match HV Bokeh default
data_smFISH = data
data_smFISH["Gene"] = data_smFISH["Gene"].astype("str")
dic_data = {i : hv.Points(data_smFISH[data_smFISH["Gene"].apply(lambda x: x == i)]
[["X_coordinate", "Y_coordinate"]]) for i in data["Gene"].unique()}
Nd = hv.NdOverlay(dic_data, kdims=["Gene"])
agg = datashade(Nd, aggregator=ds.count_cat('Gene'))
dynspread(agg, how = "over")
The text was updated successfully, but these errors were encountered: