Open gewitterblitz opened 3 years ago
If hvPlot can accept it as a parameter, there is no reason xrviz shouldn't allow custom colour maps or labels - but this is not implemented yet. I don't know really how we would be able to squeeze such specific options into the interface; perhaps we could allow for some arguments that are passed through and override whatever is selected in the interface.
hvplot indeed accepts colormap. Here's an example:
pid_plot = data.PID.isel(time=17,z0=15).hvplot(colorbar=True,height=600,width=800).opts(colorbar_opts={
'background_fill_alpha':0.1,
'bar_line_width':2,
'label_standoff':8,
'major_label_text_font_size':2,
'major_label_overrides':clabs,
'ticker': ticker
},
clim = (1,18),
cmap=cmapncarpid,
)
pid_plot
Output:
I think I am stuck in between xrviz and a pure hvplot based animation approach because even though I could generate a static hvplot plot, the animation based approach provided by @philippjfr here does not allow me to change ticklabels and varying two dimensions (42 timesteps + 40 z values) is apparently too big to animate. Here is the code and warning I get when I do that:
Code:
data['PID'] = data['PID'].where(data['PID'] >=1)
time = pn.widgets.Player(name='time', start=0, end=42, loop_policy='loop', interval=100)
alt = pn.widgets.Select(name='alt', value=15, options = list(np.arange(0,40,1)))
pid_plot = data.PID.interactive.isel(time=time).isel(z0=alt).hvplot(colorbar=True,height=600,width=800,cmap=cmapncarpid,
)
pid_plot
Warning message:
WARNING:param.Parameterized: Use method 'warning' via param namespace
WARNING:param.Parameterized:Use method 'warning' via param namespace
WARNING:param.main: The cross product of different application states is very large to explore (N=1680), consider reducing the number of options on the widgets or increase the max_states specified in the function to remove this warning
My notebook crashes after trying too hard to render the animation this way.
Hi,
I have two questions:
Here's my implementation of an animation using an xarray dataset:
However, when I use the custom cmap
ncarpid
, it is not recognized by xrviz.Here's an example of the dashboard generated from code snippet above: