psyplot / psy-maps

The psyplot plugin for visualizations on a map
https://psyplot.github.io/psy-maps
8 stars 5 forks source link

Mapplot covers whole figure when using map_extent and saved as .png #38

Closed swester closed 2 years ago

swester commented 3 years ago

Code Sample, a copy-pastable example if possible

p = psy.plot.mapplot(in_file,
                     name=var_name,
                     projection=projection,
                     map_extent=[lonmin,lonmax,latmin,latmax])

plt.savefig('plot.png')

Problem description

The plotted area extends over the whole figure when I specify a sub-domain with map_extent. The issue does not occur when the script is employed interactively within ipython, only when the figure is saved as .png. Additionally specifying lonlatbox=[lonmin,lonmax,latmin,latmax] does not solve the issue.

Expected Output

I'd like to have a clean cut at the edges.

Output of psyplot -aV

psy_maps.plugin: requirements: cartopy: 0.18.0 version: 1.3.2 psy_reg.plugin: requirements: scipy: 1.5.3 statsmodels: 0.11.1 version: 1.3.0 psy_simple.plugin: version: 1.3.1 psyplot: requirements: matplotlib: 3.3.4 numpy: 1.18.1 pandas: 1.1.4 python: 3.8.5 (default, Sep 4 2020, 07:30:14) [GCC 7.3.0] xarray: 0.17.0 version: 1.3.1 psyplot_gui: requirements: pyqt: 5.9.2 qt: 5.9.7 qtconsole: 5.0.3 version: 1.3.0

NOTE

hsurf

Chilipp commented 2 years ago

hey @swester! my apologies for the delay! I will resolve this with the release that will be published this week. I am closing this issue as a duplicate of #37