pySTEPS / pysteps

Python framework for short-term ensemble prediction systems.
https://pysteps.github.io/
BSD 3-Clause "New" or "Revised" License
471 stars 168 forks source link

plot_map_cartopy creates maps without geographical axis #434

Open cix1 opened 2 months ago

cix1 commented 2 months ago

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!