13
13
import numpy as np
14
14
import matplotlib .pyplot as plt
15
15
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 )
19
20
from mpl_toolkits .axisartist .axislines import Subplot
20
21
21
- import mpl_toolkits .axisartist .angle_helper as angle_helper
22
-
23
22
24
23
def curvelinear_test1 (fig ):
25
24
"""Grid for custom transform."""
@@ -34,25 +33,16 @@ def inv_tr(x, y):
34
33
x , y = np .asarray (x ), np .asarray (y )
35
34
return sgn * x ** 2 , y
36
35
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 ))
50
41
51
42
ax1 = Subplot (fig , 111 , grid_helper = grid_helper )
52
43
# 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.
56
46
57
47
fig .add_subplot (ax1 )
58
48
0 commit comments