Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6e8d6e9

Browse files
authored
Merge pull request #13875 from anntzer/grid_helper_c
Style fixes for grid_helper_curvelinear.
2 parents 29aaad8 + 77497bb commit 6e8d6e9

File tree

1 file changed

+11
-19
lines changed

1 file changed

+11
-19
lines changed

lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py

Lines changed: 11 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -115,26 +115,11 @@ def update_lim(self, axes):
115115
if e2 is not None:
116116
extremes[1] = min(e2, extremes[1])
117117

118-
grid_info = dict()
119118
lon_min, lon_max, lat_min, lat_max = extremes
120119
lon_levs, lon_n, lon_factor = \
121120
grid_finder.grid_locator1(lon_min, lon_max)
122121
lat_levs, lat_n, lat_factor = \
123122
grid_finder.grid_locator2(lat_min, lat_max)
124-
grid_info["extremes"] = extremes
125-
126-
grid_info["lon_info"] = lon_levs, lon_n, lon_factor
127-
grid_info["lat_info"] = lat_levs, lat_n, lat_factor
128-
129-
grid_info["lon_labels"] = grid_finder.tick_formatter1("bottom",
130-
lon_factor,
131-
lon_levs)
132-
133-
grid_info["lat_labels"] = grid_finder.tick_formatter2("bottom",
134-
lat_factor,
135-
lat_levs)
136-
137-
grid_finder = self.grid_helper.grid_finder
138123

139124
if self.nth_coord == 0:
140125
xx0 = np.linspace(self.value, self.value, self._line_num_points)
@@ -145,8 +130,16 @@ def update_lim(self, axes):
145130
yy0 = np.linspace(self.value, self.value, self._line_num_points)
146131
xx, yy = grid_finder.transform_xy(xx0, yy0)
147132

148-
grid_info["line_xy"] = xx, yy
149-
self.grid_info = grid_info
133+
self.grid_info = {
134+
"extremes": extremes,
135+
"lon_info": (lon_levs, lon_n, lon_factor),
136+
"lat_info": (lat_levs, lat_n, lat_factor),
137+
"lon_labels": grid_finder.tick_formatter1(
138+
"bottom", lon_factor, lon_levs),
139+
"lat_labels": grid_finder.tick_formatter2(
140+
"bottom", lat_factor, lat_levs),
141+
"line_xy": (xx, yy),
142+
}
150143

151144
def get_axislabel_transform(self, axes):
152145
return Affine2D() # axes.transData
@@ -346,8 +339,7 @@ def new_fixed_axis(self, loc,
346339
axes = self.axes
347340
if axis_direction is None:
348341
axis_direction = loc
349-
_helper = FixedAxisArtistHelper(
350-
self, loc, nth_coord_ticks=nth_coord)
342+
_helper = FixedAxisArtistHelper(self, loc, nth_coord_ticks=nth_coord)
351343
axisline = AxisArtist(axes, _helper, axis_direction=axis_direction)
352344
# Why is clip not set on axisline, unlike in new_floating_axis or in
353345
# the floating_axig.GridHelperCurveLinear subclass?

0 commit comments

Comments
 (0)