pysteps icon indicating copy to clipboard operation
pysteps copied to clipboard

plot_map_cartopy creates maps without geographical axis

Open cix1 opened this issue 1 year ago • 0 comments

Hi all,

I noticed a bug in the visualisation of maps with cartopy. The plot_map_cartopy function creates maps without geographical axis. The part of the code that results in this issue is:

if not isinstance(ax, GeoAxesSubplot):
     ax = plt.subplot(ax.get_subplotspec(), projection=crs)
     # cax.clear()
     ax.set_axis_off()

I think this problem can be solved through the following adjustment:

if not isinstance(ax, GeoAxesSubplot):
    ax.set_axis_off()
    ax = plt.subplot(ax.get_subplotspec(), projection=crs)
    # cax.clear()
    ax.xaxis.set_visible(True)
    ax.yaxis.set_visible(True)

Thanks!

cix1 avatar Sep 21 '24 08:09 cix1