hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

`opts` should be mentioned in hvplot customization reference page

Open ahuang11 opened this issue 2 years ago • 2 comments

I think many people are unaware that opts can be used with hvplot; a brief mention could help guide them.

ahuang11 avatar Dec 01 '23 21:12 ahuang11

@ahuang11 - Looks like you beat me to opening this issue! Thanks!

For people wanting more details or taking on this issue, here's some background:

https://discourse.holoviz.org/t/pandas-hvplot-datashader-and-legends/299/8

As a brief summary of the discourse discussion, there are a lot of plot customization options available in hvPlot, but they're not well documented as to how and when they can be used. Some of those options are ignored when specific flags are set, such as datashade=True or rasterize=True

magic-lantern avatar Dec 04 '23 21:12 magic-lantern

Yes the hvPlot API has many parameters available and could be better documented.

The main parameters and special plot parameters (e.g. cumulative for hist()) are described in the Customization guide. It's likely parts of that guide aren't up to date, it's also not very pretty. We could also imagine extending the Reference section with a visual representation of using these parameters (visual API ref).

hvPlot can also directly propagate HoloViews style options, e.g. df.hvplot.line(line_dash='dashed') where line_dash is entirely unknown to hvPlot's code base. The Customization guide describes how to get the list of style options. It doesn't say anything about the values available, mostly because I think that even HoloViews has no clue about them? On this front, we could probably guide users more on how to find the values they can pass to these options. Plot references could demonstrate the usage of some of the most useful styling options. Setting style options is slightly made more complicated by the fact that hvPlot supports different backends and styling options differ between backends, this is explained in further detail in the Plotting Extensions guide. These two guides should certainly reference each other.

Finally, there's the ultimate escape hatch obj.opts(..) that allows you to set any kind of option on a HoloViews object. Adding a section to the Customization guide about this possibility sounds good to me. It should certainly link to https://holoviews.org/user_guide/Applying_Customizations.html.

maximlt avatar Dec 05 '23 18:12 maximlt