Closed rtaib closed 1 year ago
That's odd - nothing relevant has changed at our end since the last time I tested the styling API in a Notebook.
Something must have changed in Jupyter or matplotlib I guess.
Should be fixable by calling matplotlib.use("nbAgg")
inside datacube_ows.styles.base.plot_image()
.
Ah! You must be right, because I'm pretty sure it was working a few months ago (v1.8.26 then) and I don't think this bit of code changed in the meantime. However, our JLab or matplotlib may have been updated. If your suggested fix works, that would be great, though.
I see this issue is still open. For what it's worth, the changes @SpacemanPaul made in #886 seem to have fixed the issue for me, tested with v1.8.33. Thanks!
Description
When testing the styles programmatically in a Notebook, as per the documentation the plots do not show because the backend is set to
Agg
bydatacube_ows/styles/ramp.py
. The user must use%matplotlib inline
before using, e.g.,plot_image_with_style_cfg()
Steps to Reproduce
In a Notebook, pull some
data
from ODC and define argb_cfg
style, just as shown in the docs. Then:This does not produce any plot, and indeed,
plt.get_backend()
returnsagg
.Context (Environment)
datacube-ows
version (datacube-ows --version):1.8.28
ows_config.py
file (link, sample code)N/A
datacube product metadata (datacube product show product_name)
N/A