@@ -267,7 +267,7 @@ def format(
267
267
)
268
268
super ().format (** kwargs )
269
269
270
- def _get_latlines (self , step , latmax = None , user = None , ** kwargs ):
270
+ def _get_latlines (self , step , latmax = None ):
271
271
"""
272
272
Get latitude lines every `step` degrees.
273
273
"""
@@ -287,7 +287,7 @@ def _get_latlines(self, step, latmax=None, user=None, **kwargs):
287
287
latlines = np .append (- latlines [::- 1 ], latlines [1 :])
288
288
return list (latlines )
289
289
290
- def _get_lonlines (self , step , lon0 = None , user = None , ** kwargs ):
290
+ def _get_lonlines (self , step , lon0 = None ):
291
291
"""
292
292
Get longitude lines every `step` degrees.
293
293
"""
@@ -434,6 +434,7 @@ def _format_apply(
434
434
Apply formatting to cartopy axes. Extra kwargs are used to update proj4 params.
435
435
"""
436
436
latmax # prevent U100 error (cartopy handles 'latmax' automatically)
437
+ lonlines_kw , latlines_kw # preven U100 error (these were already applied)
437
438
import cartopy .feature as cfeature
438
439
import cartopy .crs as ccrs
439
440
from cartopy .mpl import ticker
@@ -577,7 +578,7 @@ def _add_gridline_label(self, value, axis, upper_end):
577
578
extent = [* lonlim , * latlim ]
578
579
self .set_extent (extent , crs = ccrs .PlateCarree ())
579
580
580
- # Gridline properties including an axes.axisbelow-mimicking property
581
+ # Gridline collection properties including axes.axisbelow-mimicking property
581
582
kw = rc .fill ({
582
583
'alpha' : 'geogrid.alpha' ,
583
584
'color' : 'geogrid.color' ,
@@ -596,9 +597,17 @@ def _add_gridline_label(self, value, axis, upper_end):
596
597
raise ValueError (f'Unexpected geogrid.axisbelow value { axisbelow !r} .' )
597
598
kw ['zorder' ] = zorder
598
599
gl .collection_kwargs .update (kw )
600
+
601
+ # Special gridline properties
599
602
pad = rc .get ('geogrid.labelpad' , context = True )
600
603
if pad is not None :
601
604
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
602
611
603
612
# Gridline longitudes and latitudes
604
613
eps = 1e-10
@@ -904,11 +913,17 @@ def _get_lon_0(self, step=5):
904
913
905
914
def _get_lonlines (self , step , user = False , ** kwargs ):
906
915
"""Get longitude line locations given the input step."""
916
+ user , kwargs # prevent U100 error (this is used in cartopy subclass)
907
917
# Locations do not have to wrap around like they do in cartopy
908
918
lonlines = super ()._get_lonlines (step )
909
919
lonlines = lonlines [:- 1 ]
910
920
return lonlines
911
921
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
+
912
927
def _format_apply (
913
928
self , * , patch_kw ,
914
929
lonlim , latlim , boundinglat ,
0 commit comments