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

Skip to content

Style fixes for grid_helper_curvelinear. #13875

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 11 additions & 19 deletions lib/mpl_toolkits/axisartist/grid_helper_curvelinear.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,26 +115,11 @@ def update_lim(self, axes):
if e2 is not None:
extremes[1] = min(e2, extremes[1])

grid_info = dict()
lon_min, lon_max, lat_min, lat_max = extremes
lon_levs, lon_n, lon_factor = \
grid_finder.grid_locator1(lon_min, lon_max)
lat_levs, lat_n, lat_factor = \
grid_finder.grid_locator2(lat_min, lat_max)
grid_info["extremes"] = extremes

grid_info["lon_info"] = lon_levs, lon_n, lon_factor
grid_info["lat_info"] = lat_levs, lat_n, lat_factor

grid_info["lon_labels"] = grid_finder.tick_formatter1("bottom",
lon_factor,
lon_levs)

grid_info["lat_labels"] = grid_finder.tick_formatter2("bottom",
lat_factor,
lat_levs)

grid_finder = self.grid_helper.grid_finder

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

grid_info["line_xy"] = xx, yy
self.grid_info = grid_info
self.grid_info = {
"extremes": extremes,
"lon_info": (lon_levs, lon_n, lon_factor),
"lat_info": (lat_levs, lat_n, lat_factor),
"lon_labels": grid_finder.tick_formatter1(
"bottom", lon_factor, lon_levs),
"lat_labels": grid_finder.tick_formatter2(
"bottom", lat_factor, lat_levs),
"line_xy": (xx, yy),
}

def get_axislabel_transform(self, axes):
return Affine2D() # axes.transData
Expand Down Expand Up @@ -346,8 +339,7 @@ def new_fixed_axis(self, loc,
axes = self.axes
if axis_direction is None:
axis_direction = loc
_helper = FixedAxisArtistHelper(
self, loc, nth_coord_ticks=nth_coord)
_helper = FixedAxisArtistHelper(self, loc, nth_coord_ticks=nth_coord)
axisline = AxisArtist(axes, _helper, axis_direction=axis_direction)
# Why is clip not set on axisline, unlike in new_floating_axis or in
# the floating_axig.GridHelperCurveLinear subclass?
Expand Down