@@ -267,7 +267,7 @@ def format(
267267 )
268268 super ().format (** kwargs )
269269
270- def _get_latlines (self , step , latmax = None , user = None , ** kwargs ):
270+ def _get_latlines (self , step , latmax = None ):
271271 """
272272 Get latitude lines every `step` degrees.
273273 """
@@ -287,7 +287,7 @@ def _get_latlines(self, step, latmax=None, user=None, **kwargs):
287287 latlines = np .append (- latlines [::- 1 ], latlines [1 :])
288288 return list (latlines )
289289
290- def _get_lonlines (self , step , lon0 = None , user = None , ** kwargs ):
290+ def _get_lonlines (self , step , lon0 = None ):
291291 """
292292 Get longitude lines every `step` degrees.
293293 """
@@ -434,6 +434,7 @@ def _format_apply(
434434 Apply formatting to cartopy axes. Extra kwargs are used to update proj4 params.
435435 """
436436 latmax # prevent U100 error (cartopy handles 'latmax' automatically)
437+ lonlines_kw , latlines_kw # preven U100 error (these were already applied)
437438 import cartopy .feature as cfeature
438439 import cartopy .crs as ccrs
439440 from cartopy .mpl import ticker
@@ -577,7 +578,7 @@ def _add_gridline_label(self, value, axis, upper_end):
577578 extent = [* lonlim , * latlim ]
578579 self .set_extent (extent , crs = ccrs .PlateCarree ())
579580
580- # Gridline properties including an axes.axisbelow-mimicking property
581+ # Gridline collection properties including axes.axisbelow-mimicking property
581582 kw = rc .fill ({
582583 'alpha' : 'geogrid.alpha' ,
583584 'color' : 'geogrid.color' ,
@@ -596,9 +597,17 @@ def _add_gridline_label(self, value, axis, upper_end):
596597 raise ValueError (f'Unexpected geogrid.axisbelow value { axisbelow !r} .' )
597598 kw ['zorder' ] = zorder
598599 gl .collection_kwargs .update (kw )
600+
601+ # Special gridline properties
599602 pad = rc .get ('geogrid.labelpad' , context = True )
600603 if pad is not None :
601604 gl .xpadding = gl .ypadding = pad
605+ loninline = rc .get ('geogrid.loninline' , context = True )
606+ if loninline is not None :
607+ gl .x_inline = loninline
608+ latinline = rc .get ('geogrid.latinline' , context = True )
609+ if latinline is not None :
610+ gl .y_inline = latinline
602611
603612 # Gridline longitudes and latitudes
604613 eps = 1e-10
@@ -904,11 +913,17 @@ def _get_lon_0(self, step=5):
904913
905914 def _get_lonlines (self , step , user = False , ** kwargs ):
906915 """Get longitude line locations given the input step."""
916+ user , kwargs # prevent U100 error (this is used in cartopy subclass)
907917 # Locations do not have to wrap around like they do in cartopy
908918 lonlines = super ()._get_lonlines (step )
909919 lonlines = lonlines [:- 1 ]
910920 return lonlines
911921
922+ def _get_latlines (self , step , latmax = None , user = False , ** kwargs ):
923+ """Get latitude line locations given the input step."""
924+ user , kwargs # prevent U100 error (these are used in cartopy subclass)
925+ return super ()._get_latlines (step , latmax = latmax )
926+
912927 def _format_apply (
913928 self , * , patch_kw ,
914929 lonlim , latlim , boundinglat ,
0 commit comments