hvplot icon indicating copy to clipboard operation
hvplot copied to clipboard

Re-add an Examples section to the plotting method docstrings

Open maximlt opened this issue 7 months ago • 0 comments

In https://github.com/holoviz/hvplot/pull/1625 I removed the Examples section of each plotting method docstring as we now have a more extended Examples section added to each reference page, building it from a notebook. However, this means that users typing hvPlot(df).line() in an IDE will no longer see the Examples section. We should find a way to fix that. Some approaches:

  • Add the Examples section to each docstring when building hvPlot (I think seaborn does that?)
  • Have a pre-commit hook that reads a plotting method notebook and copies its Example section to the plotting method docstring in core.py

Note that I have made sure that each Examples section starts with a simple example that can be run without having to install hvsampledata so users are more likely to be able to run them. Usually, they manually build a Pandas DataFrame or an Xarray Dataset. We could also decide to only include that first example not to make the docstring too long. I think it'd rather have the full Examples section.

maximlt avatar Jul 31 '25 09:07 maximlt