1

I am trying to save an hvplot.quadmesh plot to file as an image (PNG). The plot looks as I expect/want when rendered inline in jupyter notebook, and when exported as an HTML (see first linked screenshot image), but there are strange grid artefacts when the plot is saved as a PNG (see second linked image). Does anyone know how to resolve this? My code is reproduced below:

annual_mean_ch4_2020 = rxr.open_rasterio(annual_means_files[3]).to_dataset(dim='band', promote_attrs=True)    
plot = annual_mean_ch4_2020.hvplot.quadmesh('x', 'y', 'ch4', crs=epsg4326, geo=True,
                                            global_extent=False, frame_height=540, cmap='viridis',
                                            projection= ccrs.PlateCarree(),
                                            coastline=None,
                                            tiles='CartoLight',
                                            features = {'land': '10m',
                                                       'ocean' : '10m'},
                                            clabel = 'TROPOMI XCH4 (ppb)',
                                            rasterize=False,
                                            grid=False,
                                            #xaxis=None,
                                            #yaxis=None,
                                            xlim = (-74, -10),
                                            line_alpha=0,
                                            line_width=0,
                                            hover_line_alpha=0)

hvplot.save(plot, 'test_hvplot_map.png')

hvplot.quadmesh plot saved as PNG image with strange artefacts hvplot.quadmesh plot saved as HTML without artefacts

bmdsy94
  • 11
  • 2
  • Maybe here is a similar problem with hvplot.quadmesh. It might have something to do either with coordinates. Can you specify them in your code with `x='longitude', y='latitude'` or you could try it with `annual_mean_ch4_2020.unify_chunks().hvplot.quadmesh` (or both): https://discourse.holoviz.org/t/hvplot-reporting-inconsistent-chunks-on-xarray-dataarray/1690/2 – Swawa Aug 02 '22 at 13:04

0 Answers0