Plot options not applied when changed interactively
See original GitHub issueHi everyone,
I currently have the problem that I cannot change the options of my plot through interactivity with parambokeh. An example code is as follows:
def density_view(det_den, ran, main_axes=1):
nature_list = ['All'] + list(ran.to_dict()['name'].values())
curr_den = np.swapaxes(det_den, 1, main_axes)
class DensityView(Stream):
slider1 = param.Integer(default=10, bounds=(0, np.shape(curr_den)[main_axes]-1))
colormap1 = param.ObjectSelector(default="gray", objects=["gray", "jet", "fire"])
nature = param.ObjectSelector(default="All", objects=nature_list)
cbar = param.Boolean(True)
def view(self, xrange=None, yrange=None, **kwargs):
nature_index = nature_list.index(str(self.nature)) - 1
curr_density = curr_den[nature_index, :, :, :]
options = dict(colorbar=self.cbar, xaxis=None, yaxis=None, cmap=str(self.colormap1))
im = hv.Image(np.squeeze(curr_density[self.slider1, :,:])).opts(plot=options)
return im
return DensityView()
So, when I change the cmap param or cbar param, it does not change interactively. I have to replot for seeing the change, whereas the slider and nature params are interactive.
Plotting is started like this:
det_explorer = density_view(det_density, ran)
parambokeh.Widgets(det_explorer, callback=det_explorer.event)
hv.DynamicMap(det_explorer.view, streams=[det_explorer])
Backend is matplotlib.
Versions: param – 1.6.1 parambokeh – 0.2.2 matplotlib – 2.2.2 holoviews – 1.10.7
Please tell me if you need more information.
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
Bokeh interactively changing the columns being plotted
I just want a single plot where I can interactively change the columns used for the x and y axis and the plot...
Read more >Changing plot settings — splash v3.4.0 documentation
The position of the time legend can be set interactively by positioning the mouse in the plot window and pressing 'G'. To set...
Read more >Modifying the Plot - MATLAB & Simulink
To change the properties of a plot, first click the Send to Figure button in the toolstrip to open a new figure window...
Read more >Plot Live, Changing Data - ScottPlot FAQ
After plotting an array you can change its values and re-render at any time. This is the most performant option for displaying changing...
Read more >Interactive Plots — FiftyOne 0.18.0 documentation
view changes. View plots can be used to construct dynamic dashboards that update to reflect the contents of your current view. More view...
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
I’d strongly recommend looking into http://panel.pyviz.org which is an infinitely superior replacement for parambokeh.
Here I have found out that this problem mostly occurs in matplotlib. So, in matplotlib no option change is dynamic, in bokeh almost all are dynamic except options like activating/deactivating cbar.
Example:
Code: