Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit e528dad

Browse files
adrnpelson
authored andcommitted
Raise exception when user tries to use set_xlim or set_ylim on a geo projection
1 parent 301d6df commit e528dad

File tree

1 file changed

+3
-2
lines changed
  • lib/matplotlib/projections

1 file changed

+3
-2
lines changed

lib/matplotlib/projections/geo.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,8 +158,9 @@ def set_yscale(self, *args, **kwargs):
158158
set_xscale = set_yscale
159159

160160
def set_xlim(self, *args, **kwargs):
161-
Axes.set_xlim(self, -np.pi, np.pi)
162-
Axes.set_ylim(self, -np.pi / 2.0, np.pi / 2.0)
161+
raise TypeError("It is not possible to change axes limits "
162+
"for geographic projections. Please consider "
163+
"using Basemap or Cartopy.")
163164

164165
set_ylim = set_xlim
165166

0 commit comments

Comments
 (0)