1 year ago
#141249
Ben
How do I plot an irregularly gridded RGB using holoview QuadMesh?
I am working with irregularly gridded earth observation data, and am trying to find ways to plot this efficiently using holoview with bokeh as the backend. I wish to avoid interpolation if at all possible.
Plotting regularly gridded data seems simple enough via the RGB method Holoviews RGB coordinates. However, the approach for irregularly gridded data seems to be to use Quadmesh. Implementing this, and using datashading to conserve memory, is simple enough for a single channel of data mapped to a defined colourmap, e.g.;
qmesh = hv.QuadMesh((lon, lat, band_dict['Oa08_radiance']))
datashade(qmesh, cmap=plt.cm.viridis).opts(width=np.shape(lon)[0], height=np.shape(lon)[1])
So far, so good, but despite my best efforts, I can't find a way to implement this for 3-channel RGB. In my previous matplotlib attempts to achieve the same thing, I passed either a tuple to the pcolormesh "color" argument, or a LinearSegmentedColormap to the "cmap" argument. Neither work in this case.
Surprisingly, I can find no pre-existing examples of this; which makes me wonder if what I am attempting is impossible. Has anyone else attempted the same and can help?
python
bokeh
holoviews
datashader
0 Answers
Your Answer