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

Skip to content

Commit 3290982

Browse files
committed
FIX : fix order of operation in __init__ functions
1 parent 406e8ce commit 3290982

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/matplotlib/artist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ class Artist(object):
8686
zorder = 0
8787

8888
def __init__(self):
89+
self._stale = True
8990
self._axes = None
9091
self.figure = None
9192

@@ -117,7 +118,6 @@ def __init__(self):
117118
self._snap = None
118119
self._sketch = rcParams['path.sketch']
119120
self._path_effects = rcParams['path.effects']
120-
self._stale = True
121121

122122
def __getstate__(self):
123123
d = self.__dict__.copy()

lib/matplotlib/collections.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,6 @@ def __init__(self, segments, # Can be None.
11031103
linewidths = (mpl.rcParams['lines.linewidth'],)
11041104
if antialiaseds is None:
11051105
antialiaseds = (mpl.rcParams['lines.antialiased'],)
1106-
self.set_linestyles(linestyles)
11071106

11081107
colors = mcolors.colorConverter.to_rgba_array(colors)
11091108

@@ -1122,6 +1121,8 @@ def __init__(self, segments, # Can be None.
11221121
zorder=zorder,
11231122
**kwargs)
11241123

1124+
self.set_linestyles(linestyles)
1125+
11251126
self.set_segments(segments)
11261127

11271128
def set_segments(self, segments):

lib/matplotlib/patches.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,8 +1444,8 @@ def __init__(self, xy, radius=5, **kwargs):
14441444
%(Patch)s
14451445
14461446
"""
1447-
self.radius = radius
14481447
Ellipse.__init__(self, xy, radius * 2, radius * 2, **kwargs)
1448+
self.radius = radius
14491449

14501450
def set_radius(self, radius):
14511451
"""
@@ -4002,6 +4002,7 @@ def __init__(self, posA=None, posB=None,
40024002
Valid kwargs are:
40034003
%(Patch)s
40044004
"""
4005+
Patch.__init__(self, **kwargs)
40054006

40064007
if posA is not None and posB is not None and path is None:
40074008
self._posA_posB = [posA, posB]
@@ -4021,8 +4022,6 @@ def __init__(self, posA=None, posB=None,
40214022
self.shrinkA = shrinkA
40224023
self.shrinkB = shrinkB
40234024

4024-
Patch.__init__(self, **kwargs)
4025-
40264025
self._path_original = path
40274026

40284027
self.set_arrowstyle(arrowstyle)

0 commit comments

Comments
 (0)