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

Skip to content

Commit cefae87

Browse files
committed
Placate flake8.
1 parent ed0a056 commit cefae87

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

examples/specialty_plots/skewt.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,10 @@
2727
# interval as appropriate and see what parts of the tick to draw, if any.
2828
class SkewXTick(maxis.XTick):
2929
def draw(self, renderer):
30+
# When adding the callbacks with `stack.callback`, we fetch the current
31+
# visibility state of the artist with `get_visible`; the ExitStack will
32+
# restore these states (`set_visible`) at the end of the block (after
33+
# the draw).
3034
with ExitStack() as stack:
3135
for artist in [self.gridline, self.tick1line, self.tick2line,
3236
self.label1, self.label2]:

lib/matplotlib/axis.py

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import numpy as np
1010

1111
from matplotlib import rcParams
12-
import matplotlib.artist as artist
12+
import matplotlib.artist as martist
1313
import matplotlib.cbook as cbook
1414
from matplotlib.cbook import _string_to_bool
1515
import matplotlib.font_manager as font_manager
@@ -27,14 +27,14 @@
2727

2828
# This list is being used for compatibility with Axes.grid, which
2929
# allows all Line2D kwargs.
30-
_line_AI = artist.ArtistInspector(mlines.Line2D)
30+
_line_AI = martist.ArtistInspector(mlines.Line2D)
3131
_line_param_names = _line_AI.get_setters()
3232
_line_param_aliases = [list(d)[0] for d in _line_AI.aliasd.values()]
3333
_gridline_param_names = ['grid_' + name
3434
for name in _line_param_names + _line_param_aliases]
3535

3636

37-
class Tick(artist.Artist):
37+
class Tick(martist.Artist):
3838
"""
3939
Abstract base class for the axis ticks, grid lines and labels
4040
@@ -81,7 +81,7 @@ def __init__(self, axes, loc, label,
8181
loc is the tick location in data coords
8282
size is the tick size in points
8383
"""
84-
artist.Artist.__init__(self)
84+
martist.Artist.__init__(self)
8585

8686
if gridOn is None:
8787
if major and (rcParams['axes.grid.which'] in ('both', 'major')):
@@ -230,11 +230,11 @@ def get_children(self):
230230
return children
231231

232232
def set_clip_path(self, clippath, transform=None):
233-
artist.Artist.set_clip_path(self, clippath, transform)
233+
martist.Artist.set_clip_path(self, clippath, transform)
234234
self.gridline.set_clip_path(clippath, transform)
235235
self.stale = True
236236

237-
set_clip_path.__doc__ = artist.Artist.set_clip_path.__doc__
237+
set_clip_path.__doc__ = martist.Artist.set_clip_path.__doc__
238238

239239
def get_pad_pixels(self):
240240
return self.figure.dpi * self._base_pad / 72
@@ -289,7 +289,7 @@ def get_loc(self):
289289
'Return the tick location (data coords) as a scalar'
290290
return self._loc
291291

292-
@artist.allow_rasterization
292+
@martist.allow_rasterization
293293
def draw(self, renderer):
294294
if not self.get_visible():
295295
self.stale = False
@@ -669,7 +669,7 @@ def __get__(self, instance, cls):
669669
return instance.minorTicks
670670

671671

672-
class Axis(artist.Artist):
672+
class Axis(martist.Artist):
673673
"""
674674
Public attributes
675675
@@ -687,7 +687,7 @@ def __init__(self, axes, pickradius=15):
687687
"""
688688
Init the axis with the parent Axes instance
689689
"""
690-
artist.Artist.__init__(self)
690+
martist.Artist.__init__(self)
691691
self.set_figure(axes.figure)
692692

693693
self.isDefault_label = True
@@ -900,7 +900,7 @@ def _translate_tick_kw(kw):
900900
return kwtrans
901901

902902
def set_clip_path(self, clippath, transform=None):
903-
artist.Artist.set_clip_path(self, clippath, transform)
903+
martist.Artist.set_clip_path(self, clippath, transform)
904904
for child in self.majorTicks + self.minorTicks:
905905
child.set_clip_path(clippath, transform)
906906
self.stale = True
@@ -1142,7 +1142,7 @@ def get_tick_padding(self):
11421142
values.append(self.minorTicks[0].get_tick_padding())
11431143
return max(values, default=0)
11441144

1145-
@artist.allow_rasterization
1145+
@martist.allow_rasterization
11461146
def draw(self, renderer, *args, **kwargs):
11471147
'Draw the axis lines, grid lines, tick lines and labels'
11481148

0 commit comments

Comments
 (0)