0

In matplotlib one can anchor the upper/lower values of the colormap like:

import rioxarray
import xarray as xr
import hvplot.xarray
import matplotlib.pyplot as plt

da = xr.open_dataset(
    "https://coclico.blob.core.windows.net/public/s2_narrabeen_example.tif",
    engine="rasterio",
)["band_data"]
stretch_quantiles = (0.1, 0.9)
vmin, vmax = da.quantile(stretch_quantiles).values
da.plot.imshow(x="x", y="y", vmin=vmin, vmax=vmax)  # robust=True would also work
plt.show()

enter image description here

But how do you do that with a Bokeh backend for a hvplot.RGB plot?

da.hvplot.rgb(x="x", y="y", bands="band")

enter image description here

sir_olf
  • 11
  • 4

0 Answers0