1313import numpy as np
1414import matplotlib .pyplot as plt
1515
16- from mpl_toolkits .axisartist .grid_helper_curvelinear import \
17- GridHelperCurveLinear
18- from mpl_toolkits .axisartist .grid_finder import MaxNLocator
16+ from mpl_toolkits .axisartist .grid_helper_curvelinear import (
17+ GridHelperCurveLinear )
18+ from mpl_toolkits .axisartist .grid_finder import (
19+ ExtremeFinderSimple , MaxNLocator )
1920from mpl_toolkits .axisartist .axislines import Subplot
2021
21- import mpl_toolkits .axisartist .angle_helper as angle_helper
22-
2322
2423def curvelinear_test1 (fig ):
2524 """Grid for custom transform."""
@@ -34,25 +33,16 @@ def inv_tr(x, y):
3433 x , y = np .asarray (x ), np .asarray (y )
3534 return sgn * x ** 2 , y
3635
37- extreme_finder = angle_helper .ExtremeFinderCycle (20 , 20 ,
38- lon_cycle = None ,
39- lat_cycle = None ,
40- # (0, np.inf),
41- lon_minmax = None ,
42- lat_minmax = None ,
43- )
44-
45- grid_helper = GridHelperCurveLinear ((tr , inv_tr ),
46- extreme_finder = extreme_finder ,
47- # better tick density
48- grid_locator1 = MaxNLocator (nbins = 6 ),
49- grid_locator2 = MaxNLocator (nbins = 6 ))
36+ grid_helper = GridHelperCurveLinear (
37+ (tr , inv_tr ),
38+ extreme_finder = ExtremeFinderSimple (20 , 20 ),
39+ # better tick density
40+ grid_locator1 = MaxNLocator (nbins = 6 ), grid_locator2 = MaxNLocator (nbins = 6 ))
5041
5142 ax1 = Subplot (fig , 111 , grid_helper = grid_helper )
5243 # ax1 will have a ticks and gridlines defined by the given
53- # transform (+ transData of the Axes). Note that the transform of
54- # the Axes itself (i.e., transData) is not affected by the given
55- # transform.
44+ # transform (+ transData of the Axes). Note that the transform of the Axes
45+ # itself (i.e., transData) is not affected by the given transform.
5646
5747 fig .add_subplot (ax1 )
5848
0 commit comments