@@ -1200,7 +1200,7 @@ def _plot_native(self, name, *args, **kwargs):
12001200 # Now prevent internal calls from running through overrides using preprocessor
12011201 kwargs .pop ('distribution' , None ) # remove stat distributions
12021202 with context ._state_context (self , _internal_call = True ):
1203- if getattr ( self , 'name' , None ) == 'proplot_basemap ' :
1203+ if self . _name == 'basemap ' :
12041204 obj = getattr (self .projection , name )(* args , ax = self , ** kwargs )
12051205 else :
12061206 obj = getattr (super (), name )(* args , ** kwargs )
@@ -1605,7 +1605,7 @@ def _inbounds_vlim(self, x, y, z, *, to_centers=False):
16051605 # keep this in a try-except clause for now. However *internally* we should
16061606 # not reach this block unless everything is an array so raise that error.
16071607 xmask = ymask = None
1608- if self .name != 'proplot_cartesian ' :
1608+ if self ._name != 'cartesian ' :
16091609 return z # TODO: support geographic projections when input is PlateCarree()
16101610 if not all (getattr (a , 'ndim' , None ) in (1 , 2 ) for a in (x , y , z )):
16111611 raise ValueError ('Invalid input coordinates. Must be 1D or 2D arrays.' )
@@ -1629,7 +1629,7 @@ def _inbounds_vlim(self, x, y, z, *, to_centers=False):
16291629 return z
16301630 except Exception as err :
16311631 warnings ._warn_proplot (
1632- 'Failed to restrict automatic colormap normalization algorithm '
1632+ 'Failed to restrict automatic colormap normalization '
16331633 f'to in-bounds data only. Error message: { err } '
16341634 )
16351635 return z
@@ -1643,11 +1643,13 @@ def _inbounds_xylim(self, extents, x, y, **kwargs):
16431643 # WARNING: This feature is still experimental. But seems obvious. Matplotlib
16441644 # updates data limits in ad hoc fashion differently for each plotting command
16451645 # but since proplot standardizes inputs we can easily use them for dataLim.
1646- kwargs , vert = _get_vert (** kwargs )
1647- if extents is None or self .name != 'proplot_cartesian' :
1646+ if extents is None :
1647+ return
1648+ if self ._name != 'cartesian' :
16481649 return
16491650 if not x .size or not y .size :
16501651 return
1652+ kwargs , vert = _get_vert (** kwargs )
16511653 if not vert :
16521654 x , y = y , x
16531655 trans = self .dataLim
@@ -1767,8 +1769,8 @@ def _parse_format1d(
17671769 _guide_kw_to_arg ('colorbar' , kwargs , label = title )
17681770
17691771 # Apply the basic x and y settings
1770- autox = autox and self .name == 'proplot_cartesian '
1771- autoy = autoy and self .name == 'proplot_cartesian '
1772+ autox = autox and self ._name == 'cartesian '
1773+ autoy = autoy and self ._name == 'cartesian '
17721774 sx , sy = 'xy' if vert else 'yx'
17731775 kw_format = {}
17741776 if autox and autoformat : # 'x' axis
@@ -1828,9 +1830,9 @@ def _parse_plot1d(self, x, *ys, **kwargs):
18281830 x , * ys , kwargs = self ._parse_format1d (x , * ys , zerox = zerox , ** kwargs )
18291831
18301832 # Geographic corrections
1831- if self .name == 'proplot_cartopy ' and isinstance (kwargs .get ('transform' ), PlateCarree ): # noqa: E501
1833+ if self ._name == 'cartopy ' and isinstance (kwargs .get ('transform' ), PlateCarree ): # noqa: E501
18321834 x , * ys = data ._geo_cartopy_1d (x , * ys )
1833- elif self .name == 'proplot_basemap ' and kwargs .get ('latlon' , None ):
1835+ elif self ._name == 'basemap ' and kwargs .get ('latlon' , None ):
18341836 xmin , xmax = self ._lonaxis .get_view_interval ()
18351837 x , * ys = data ._geo_basemap_1d (x , * ys , xmin = xmin , xmax = xmax )
18361838
@@ -1853,7 +1855,7 @@ def _parse_format2d(self, x, y, *zs, autoformat=None, autoguide=True, **kwargs):
18531855 y = data ._meta_labels (z , axis = 0 )
18541856
18551857 # Apply labels and XY axis settings
1856- if self .name == 'proplot_cartesian ' :
1858+ if self ._name == 'cartesian ' :
18571859 # Apply labels
18581860 # NOTE: Do not overwrite existing labels!
18591861 kw_format = {}
@@ -1927,9 +1929,9 @@ def _parse_plot2d(
19271929 # Geographic corrections
19281930 if allow1d :
19291931 pass
1930- elif self .name == 'proplot_cartopy ' and isinstance (kwargs .get ('transform' ), PlateCarree ): # noqa: E501
1932+ elif self ._name == 'cartopy ' and isinstance (kwargs .get ('transform' ), PlateCarree ): # noqa: E501
19311933 x , y , * zs = data ._geo_cartopy_2d (x , y , * zs , globe = globe )
1932- elif self .name == 'proplot_basemap ' and kwargs .get ('latlon' , None ):
1934+ elif self ._name == 'basemap ' and kwargs .get ('latlon' , None ):
19331935 xmin , xmax = self ._lonaxis .get_view_interval ()
19341936 x , y , * zs = data ._geo_basemap_2d (x , y , * zs , xmin = xmin , xmax = xmax , globe = globe ) # noqa: E501
19351937 x , y = np .meshgrid (x , y ) # WARNING: required always
@@ -3707,12 +3709,7 @@ def heatmap(self, *args, aspect=None, **kwargs):
37073709 """
37083710 obj = self .pcolormesh (* args , default_discrete = False , ** kwargs )
37093711 aspect = _not_none (aspect , rc ['image.aspect' ])
3710- if self .name != 'proplot_cartesian' :
3711- warnings ._warn_proplot (
3712- 'The heatmap() command is meant for CartesianAxes. '
3713- 'Please use pcolor() or pcolormesh() instead.'
3714- )
3715- else :
3712+ if self ._name == 'cartesian' :
37163713 coords = getattr (obj , '_coordinates' , None )
37173714 xlocator = ylocator = None
37183715 if coords is not None :
@@ -3729,6 +3726,11 @@ def heatmap(self, *args, aspect=None, **kwargs):
37293726 if self .yaxis .isDefault_minloc :
37303727 kw ['ytickminor' ] = False
37313728 self .format (** kw )
3729+ else :
3730+ warnings ._warn_proplot (
3731+ 'The heatmap() command is meant for CartesianAxes. '
3732+ 'Please use pcolor() or pcolormesh() instead.'
3733+ )
37323734 return obj
37333735
37343736 @data ._preprocess ('x' , 'y' , 'u' , 'v' , ('c' , 'color' , 'colors' ))
0 commit comments