Rendering issue in hvplot.quadmesh plots when saved to PNG

Viewed 49

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

0 Answers
Related