Meta: Finding Documentation for Geoviews & Matplotlib

Hi,

I am new to Python, as the ideas behind Holoviz lured me away from R and ggplot.

However, I am having some trouble when it comes to plotting, and I am not sure where I can learn more.

For context:
I have a boatload of netCDF (.nc) files with meteorological data. I made them into an xarray.Dataset, then called geoviews.Dataset on this. When I print the geoviews.Dataset or even convert it to geoviews.FilledContours, I get exactly what I want. This was good and easy to do, thanks to the extensive xarray documentation and the many geoviews examples which show these particular steps.

The problem:
Now that I have a basic FilledContours plot, I want to customize it. The most important thing is that values below a certain threshold are a neutral background color (white in this case), while the contours are deeper shades on a selected color (blue).

Typing “geoviews.help(geoviews.FilledContours)” brings up the list of parameters. Some of these are very helpful. Others are not.

When I apply cbar_levels, the plot behaves exactly as I expect it to. However, when I use cbar_ticks in the same manner, I get pathological nonsense (ticks do not correspond to bins, and they are also scaled differently from the bins, which were specified in very same manner). The help screen leads me to believe cbar_levels and cbar_ticks behave in the same way. I tried to find the source code for geoviews.opts.FilledContours, but to no avail. I thought the logical place would be here, but it’s not. I’ve also combed through many other_init_.py files within matplotlib and geoviews with the same luck.

Holoviz is composed of many parts. matplotlib and geoviews are directly related to this, and other packages may be hidden in the background. With this in mind, if I want to learn the effects of geoviews.opts.<some_plot_type> parameters, where should I look?

If there is not an existing example in the gallery already, are you just SoL and need to find the place in the source code? I am probably missing something.

Edit: I think I figured out my particular problem by trying every combination of relevant parameters I could, however my larger problem remains: how can I reliably find these things out without spending a good portion of the day?

Imo hvplot is the friendly version of holoviews + geoviews
https://hvplot.holoviz.org/user_guide/Customization.html

gv.help(gv.Image) would be the first stop. if it’s not descriptive enough, instead of google’s searches, I’ve used the built-in holoviews/geoviews/hvplot docs page search
http://holoviews.org/search.html?q=colorbar+ticks
http://holoviews.org/user_guide/Styling_Plots.html

1 Like

Thank you! This is exactly the type of thing I was looking for.

I did not realize that hvplot was this general. Most examples I have seen use geoviews.

It looks like my big mistake was looking for something very specific (FilledCountours), when the relevant plot options are discussed at a higher level. This is different from the R packages I used in which behaviours inherited from more general functions would be clearly specified and linked together.

I am still wondering what the connection to matplotlib suggested in the geoviews.help(geoviews.FilledContours) output really is, but I am very happy to know that hvplot handles this many options on its own.

Thank you for the tip about using the internal search! The internal search of most websites I have used is not as good as an external Google, but maybe that’s not so in this case.