Skip to content
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

Kill some commented-out code. #13295

Merged
merged 1 commit into from Jan 27, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .flake8
Expand Up @@ -54,7 +54,7 @@ per-file-ignores =
mpl_toolkits/axes_grid1/colorbar.py: E225, E501
mpl_toolkits/axes_grid1/inset_locator.py: E501
mpl_toolkits/axisartist/angle_helper.py: E221
mpl_toolkits/axisartist/clip_path.py: E225, E501
mpl_toolkits/axisartist/clip_path.py: E225
mpl_toolkits/axisartist/floating_axes.py: E225, E402, E501
mpl_toolkits/axisartist/grid_helper_curvelinear.py: E225, E501
mpl_toolkits/tests/test_axes_grid1.py: E201, E202
Expand Down
5 changes: 2 additions & 3 deletions lib/matplotlib/contour.py
Expand Up @@ -829,9 +829,8 @@ def __init__(self, ax, *args,
if self.antialiased is None and self.filled:
self.antialiased = False # eliminate artifacts; we are not
# stroking the boundaries.
# The default for line contours will be taken from
# the LineCollection default, which uses the
# rcParams['lines.antialiased']
# The default for line contours will be taken from the
# LineCollection default, which uses :rc:`lines.antialiased`.

self.nchunk = kwargs.pop('nchunk', 0)
self.locator = kwargs.pop('locator', None)
Expand Down
1 change: 0 additions & 1 deletion lib/matplotlib/offsetbox.py
Expand Up @@ -1425,7 +1425,6 @@ def __init__(self, offsetbox, xy,
self._arrow_relpos = None
self.arrow_patch = None

#self._fw, self._fh = 0., 0. # for alignment
self._box_alignment = box_alignment

# frame
Expand Down
118 changes: 0 additions & 118 deletions lib/matplotlib/projections/polar.py
Expand Up @@ -1478,121 +1478,3 @@ def drag_pan(self, button, key, x, y):
PolarAxes.ThetaFormatter = ThetaFormatter
PolarAxes.RadialLocator = RadialLocator
PolarAxes.ThetaLocator = ThetaLocator


# These are a couple of aborted attempts to project a polar plot using
# cubic bezier curves.

# def transform_path(self, path):
# twopi = 2.0 * np.pi
# halfpi = 0.5 * np.pi

# vertices = path.vertices
# t0 = vertices[0:-1, 0]
# t1 = vertices[1: , 0]
# td = np.where(t1 > t0, t1 - t0, twopi - (t0 - t1))
# maxtd = td.max()
# interpolate = np.ceil(maxtd / halfpi)
# if interpolate > 1.0:
# vertices = self.interpolate(vertices, interpolate)

# vertices = self.transform(vertices)

# result = np.zeros((len(vertices) * 3 - 2, 2), float)
# codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ),
# mpath.Path.code_type)
# result[0] = vertices[0]
# codes[0] = mpath.Path.MOVETO

# kappa = 4.0 * ((np.sqrt(2.0) - 1.0) / 3.0)
# kappa = 0.5

# p0 = vertices[0:-1]
# p1 = vertices[1: ]

# x0 = p0[:, 0:1]
# y0 = p0[:, 1: ]
# b0 = ((y0 - x0) - y0) / ((x0 + y0) - x0)
# a0 = y0 - b0*x0

# x1 = p1[:, 0:1]
# y1 = p1[:, 1: ]
# b1 = ((y1 - x1) - y1) / ((x1 + y1) - x1)
# a1 = y1 - b1*x1

# x = -(a0-a1) / (b0-b1)
# y = a0 + b0*x

# xk = (x - x0) * kappa + x0
# yk = (y - y0) * kappa + y0

# result[1::3, 0:1] = xk
# result[1::3, 1: ] = yk

# xk = (x - x1) * kappa + x1
# yk = (y - y1) * kappa + y1

# result[2::3, 0:1] = xk
# result[2::3, 1: ] = yk

# result[3::3] = p1

# print(vertices[-2:])
# print(result[-2:])

# return mpath.Path(result, codes)

# twopi = 2.0 * np.pi
# halfpi = 0.5 * np.pi

# vertices = path.vertices
# t0 = vertices[0:-1, 0]
# t1 = vertices[1: , 0]
# td = np.where(t1 > t0, t1 - t0, twopi - (t0 - t1))
# maxtd = td.max()
# interpolate = np.ceil(maxtd / halfpi)

# print("interpolate", interpolate)
# if interpolate > 1.0:
# vertices = self.interpolate(vertices, interpolate)

# result = np.zeros((len(vertices) * 3 - 2, 2), float)
# codes = mpath.Path.CURVE4 * np.ones((len(vertices) * 3 - 2, ),
# mpath.Path.code_type)
# result[0] = vertices[0]
# codes[0] = mpath.Path.MOVETO

# kappa = 4.0 * ((np.sqrt(2.0) - 1.0) / 3.0)
# tkappa = np.arctan(kappa)
# hyp_kappa = np.sqrt(kappa*kappa + 1.0)

# t0 = vertices[0:-1, 0]
# t1 = vertices[1: , 0]
# r0 = vertices[0:-1, 1]
# r1 = vertices[1: , 1]

# td = np.where(t1 > t0, t1 - t0, twopi - (t0 - t1))
# td_scaled = td / (np.pi * 0.5)
# rd = r1 - r0
# r0kappa = r0 * kappa * td_scaled
# r1kappa = r1 * kappa * td_scaled
# ravg_kappa = ((r1 + r0) / 2.0) * kappa * td_scaled

# result[1::3, 0] = t0 + (tkappa * td_scaled)
# result[1::3, 1] = r0*hyp_kappa
# # result[1::3, 1] = r0 / np.cos(tkappa * td_scaled)
# # np.sqrt(r0*r0 + ravg_kappa*ravg_kappa)

# result[2::3, 0] = t1 - (tkappa * td_scaled)
# result[2::3, 1] = r1*hyp_kappa
# # result[2::3, 1] = r1 / np.cos(tkappa * td_scaled)
# # np.sqrt(r1*r1 + ravg_kappa*ravg_kappa)

# result[3::3, 0] = t1
# result[3::3, 1] = r1

# print(vertices[:6], result[:6], t0[:6], t1[:6], td[:6],
# td_scaled[:6], tkappa)
# result = self.transform(result)
# return mpath.Path(result, codes)
# transform_path_non_affine = transform_path
1 change: 0 additions & 1 deletion lib/matplotlib/textpath.py
Expand Up @@ -315,7 +315,6 @@ def get_glyphs_tex(self, prop, s, glyph_map=None,

# Gather font information and do some setup for combining
# characters into strings.
# oldfont, seq = None, []
for x1, y1, dvifont, glyph, width in page.text:
font, enc = self._get_ps_font_and_encoding(dvifont.texname)
char_id = self._get_char_id_ps(font, glyph)
Expand Down
3 changes: 0 additions & 3 deletions lib/matplotlib/tight_layout.py
Expand Up @@ -380,9 +380,6 @@ def get_tight_layout_figure(fig, axes_list, subplotspec_list, renderer,
if top is not None:
top -= (1 - kwargs["top"])

#if h_pad is None: h_pad = pad
#if w_pad is None: w_pad = pad

kwargs = auto_adjust_subplotpars(fig, renderer,
nrows_ncols=(max_nrows, max_ncols),
num1num2_list=num1num2_list,
Expand Down
29 changes: 16 additions & 13 deletions lib/mpl_toolkits/axisartist/clip_path.py
Expand Up @@ -85,23 +85,26 @@ def clip_line_to_rect(xline, yline, bbox):
ydir = y1 > y0

if x1 > x0:
lx1, ly1, c_right_ = clip([xline], [yline], x1, clip="right", xdir=xdir, ydir=ydir)
lx2, ly2, c_left_ = clip(lx1, ly1, x0, clip="left", xdir=xdir, ydir=ydir)
lx1, ly1, c_right_ = clip([xline], [yline], x1,
clip="right", xdir=xdir, ydir=ydir)
lx2, ly2, c_left_ = clip(lx1, ly1, x0,
clip="left", xdir=xdir, ydir=ydir)
else:
lx1, ly1, c_right_ = clip([xline], [yline], x0, clip="right", xdir=xdir, ydir=ydir)
lx2, ly2, c_left_ = clip(lx1, ly1, x1, clip="left", xdir=xdir, ydir=ydir)
lx1, ly1, c_right_ = clip([xline], [yline], x0,
clip="right", xdir=xdir, ydir=ydir)
lx2, ly2, c_left_ = clip(lx1, ly1, x1,
clip="left", xdir=xdir, ydir=ydir)

if y1 > y0:
ly3, lx3, c_top_ = clip(ly2, lx2, y1, clip="right", xdir=ydir, ydir=xdir)
ly4, lx4, c_bottom_ = clip(ly3, lx3, y0, clip="left", xdir=ydir, ydir=xdir)
ly3, lx3, c_top_ = clip(ly2, lx2, y1,
clip="right", xdir=ydir, ydir=xdir)
ly4, lx4, c_bottom_ = clip(ly3, lx3, y0,
clip="left", xdir=ydir, ydir=xdir)
else:
ly3, lx3, c_top_ = clip(ly2, lx2, y0, clip="right", xdir=ydir, ydir=xdir)
ly4, lx4, c_bottom_ = clip(ly3, lx3, y1, clip="left", xdir=ydir, ydir=xdir)

# lx1, ly1, c_right_ = clip([xline], [yline], x1, clip="right")
# lx2, ly2, c_left_ = clip(lx1, ly1, x0, clip="left")
# ly3, lx3, c_top_ = clip(ly2, lx2, y1, clip="right")
# ly4, lx4, c_bottom_ = clip(ly3, lx3, y0, clip="left")
ly3, lx3, c_top_ = clip(ly2, lx2, y0,
clip="right", xdir=ydir, ydir=xdir)
ly4, lx4, c_bottom_ = clip(ly3, lx3, y1,
clip="left", xdir=ydir, ydir=xdir)

c_left = [((x, y), (a + 90) % 180 - 90) for x, y, a in c_left_
if bbox.containsy(y)]
Expand Down