-
-
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
Backend error when styling elements rendered with Bokeh #824
Comments
I also tried to set the parameters as we would in an IPython notebook. Noticed that the warning disappeared but the plot remained the same. I could also add a number of junk parameters and it would make no difference to the plot itself. I am using the static_html method to plot. |
Just to keep the discussion in one place, here's my reply on StackOverflow. I just tried it myself and this seems to work fine for me: import numpy as np
import holoviews as hv
curve_opts = dict(line_color='green')
xs = np.linspace(0, np.pi*4, 100)
data = (xs, np.sin(xs))
holo_plot = hv.Curve(data, label='MY LABEL')(style=curve_opts)
renderer = hv.Store.renderers['bokeh']
with open('test.html', 'w') as f:
f.write(renderer.static_html(holo_plot)) Could you confirm whether that works for you? |
Thanks a lot for your reply. I will keep the discussion on this forum going forward. So tried your code snippet and got the following error: |
Could not get it to work if I use holoviews.Store.renderer |
@pyenthu Do you have matplotlib installed? This might be the issue... The error you posted looks like a backend issue to me. We currently have some functionality in the bokeh backend that relies on matplotlib and perhaps you don't have matplotlib installed. We hope to remove this dependency on matplotlib in future, so people with only bokeh installed can use it without problem. I've filed an issue to remind us to remove the need for matplotlib (#829) and I've updated the title of this issue as I believe the problem is related to how we handle backends. |
The issue is probably some combination of the following:
import numpy as np
import holoviews as hv
import holoviews.plotting.bokeh
hv.Store.current_backend = 'bokeh'
curve_opts = dict(line_color='green')
xs = np.linspace(0, np.pi*4, 100)
data = (xs, np.sin(xs))
holo_plot = hv.Curve(data, label='MY LABEL')(style=curve_opts)
renderer = hv.Store.renderers['bokeh']
with open('test.html', 'w') as f:
f.write(renderer.static_html(holo_plot)) I will close, please reopen if you encounter any more issues. |
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. |
I am not sure if this is an issue but I get an error trying to set the parameters via python (not Notebook) for bokeh backend.
Example:
I have asked for help on stackoverflow but just wanted to check if this is an issue or I am doing something wrong. Please excuse me if it is the latter.
If I try this
dict(line_color='green')
holo_plot = hv.Curve(data, label='MY LABEL' , style=curve_opts)
myrenderer = hv.Store.renderers['bokeh'].instance(fig='html')
out_file_name = "".join(["./OUTPUT/","gyro", "_graph.html"])
I get the following error
WARNING:root:Curve01536: Setting non-parameter attribute curve_opts={'line_color': 'green'} using a mechanism intended only for parameters
The text was updated successfully, but these errors were encountered: