0

I read in a NetCDF file with Xarray and plot it with hvplot.quadmesh.

Any idea why the colors of the plot itself look like blended or shaded while the colorbar is shown with bright colors?

How can I manipulate the plot to be shown in the color bars´ bright colors?

And also the color (and the colorbar) should be arraged to a log distribution but it does not look being applied... Why?

DS.beta_raw.hvplot.quadmesh(cmap="gouldian",
                            clim = (3000, 5000000),  # adds a widget for time  # sets colorbar limits
                            cnorm = ('log'),
                            clabel = ('normalized range corrected signal'),
                            rot = 0,  # degree rotation of ticks
                            width = 850, 
                            height = 600,
                            title = 'title',
                           )

the plot looks like: enter image description here

But I think it is not due a noisy dataset. Following is the same date set without quadmesh. It is good to be seen that the data set is only noisy in the upper center but keeps the color of the color bar in the other regions of the plot without shading it with greys:

DS.beta_raw.hvplot(cmap="gouldian",
                   clim = (3000, 5000000),  # adds a widget for time  # sets colorbar limits
                   cnorm = ('log'),
                   clabel = ('normalized range corrected signal'),
                   rot = 0,  # degree rotation of ticks
                   width = 850, 
                   height = 600,
                   title = 'title',
                   )

The plotting goes much more faster and the resulting plot looks like this:

enter image description here

However this still results in the warning:

WARNING:param.Image02985: Image dimension time is not evenly sampled to relative tolerance of 0.001. Please use the QuadMesh element for irregularly sampled data or set a higher tolerance on hv.config.image_rtol or the rtol parameter in the Image constructor.
Swawa
  • 143
  • 1
  • 9
  • To me it looks like your data just has a lot of noise and the jumble of yellow/green/blue pixels just comes off as more muted than the solid colors in the colorbar. But I’m not the best at colors so I could be wrong :) but the colorbar *is* log scale. Note the ticks increasing in powers of 10. Was there something in particular that you noticed is going wrong? – Michael Delgado May 31 '22 at 14:40
  • @MichaelDelgado thanks for you response, but I dont think it is the the noisy data set. I edited my question. Here: https://discourse.holoviz.org/t/hvplot-reporting-inconsistent-chunks-on-xarray-dataarray/1690 a very similar plot is shown but I do not understand if it contains a solution for my color problem. – Swawa May 31 '22 at 19:37
  • maybe, but what looks like noise in log space is very different from noise in linear space. Your second plot renders all variation in the [0, 2e6] range indistinguishably deep blue in the second chart, while in the first chart, this range takes up nearly the entire color spectrum. so I don't think this proves the point. I'm definitely not saying there isn't a problem here, but without your data, we can't validate/reproduce or help solve the problem. the question you linked to relates to a really specific chunking issue. is your data chunked? – Michael Delgado May 31 '22 at 21:14
  • @MichaelDelgado thanks for the try to help. I am sorry I am not shure if I am allowed to share these data on such a puplic space. If I use hvplot.image the colors are displayed bright. But I get a hint from Python that the xarray data is non-linear and that it's better to use hvplot.quadmesh. This is "shading" the colors then. Do you mean by chunked data "not linear"? – Swawa Jun 01 '22 at 11:54
  • no I mean If the data is partitioned with dask – Michael Delgado Jun 01 '22 at 14:29
  • you might have more luck by posting an issue to holoviews and getting help there, since it seems like you're seeing this as a bug in holoviews, not a usage question? but if you do that, you'll definitely need a reproducible example. You don't need to use your actual dataset - just create a new array that demonstrates the issue you're seeing. This will be challenging, but will probably help clarify the problem, too. See this guide to [crafting minimal bug reports](https://matthewrocklin.com/blog/work/2018/02/28/minimal-bug-reports). Good luck! – Michael Delgado Jun 01 '22 at 15:57

0 Answers0