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

Skip to content

Commit 6db67ad

Browse files
committed
Merge remote-tracking branch 'upstream/v2.x'
2 parents 9c100c9 + a38e1da commit 6db67ad

File tree

7 files changed

+50
-9
lines changed

7 files changed

+50
-9
lines changed

lib/matplotlib/axes/_axes.py

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@
4545

4646
rcParams = matplotlib.rcParams
4747

48+
_alias_map = {'color': ['c'],
49+
'linewidth': ['lw'],
50+
'linestyle': ['ls'],
51+
'facecolor': ['fc'],
52+
'edgecolor': ['ec'],
53+
'markerfacecolor': ['mfc'],
54+
'markeredgecolor': ['mec'],
55+
'markeredgewidth': ['mew'],
56+
'markersize': ['ms'],
57+
}
58+
4859

4960
def _plot_args_replacer(args, data):
5061
if len(args) == 1:
@@ -1417,11 +1428,7 @@ def plot(self, *args, **kwargs):
14171428
self.cla()
14181429
lines = []
14191430

1420-
# Convert "c" alias to "color" immediately, to avoid
1421-
# confusion farther on.
1422-
c = kwargs.pop('c', None)
1423-
if c is not None:
1424-
kwargs['color'] = c
1431+
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
14251432

14261433
for line in self._get_lines(*args, **kwargs):
14271434
self.add_line(line)
@@ -3173,8 +3180,8 @@ def boxplot(self, x, notch=None, sym=None, vert=None, whis=None,
31733180
``shownotches`` is also True. Otherwise, means will be shown
31743181
as points.
31753182
3176-
Additional Options
3177-
---------------------
3183+
Other Parameters
3184+
----------------
31783185
The following boolean options toggle the drawing of individual
31793186
components of the boxplots:
31803187
- showcaps: the caps on the ends of whiskers
@@ -4575,6 +4582,8 @@ def fill(self, *args, **kwargs):
45754582
if not self._hold:
45764583
self.cla()
45774584

4585+
kwargs = cbook.normalize_kwargs(kwargs, _alias_map)
4586+
45784587
patches = []
45794588
for poly in self._get_patches_for_fill(*args, **kwargs):
45804589
self.add_patch(poly)

lib/matplotlib/patches.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ def update_from(self, other):
184184
self.set_linewidth(other.get_linewidth())
185185
self.set_linestyle(other.get_linestyle())
186186
self.set_transform(other.get_data_transform())
187-
self.set_figure(other.get_figure())
188187
self.set_alpha(other.get_alpha())
189188

190189
def get_extents(self):

lib/matplotlib/tests/test_cycles.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,30 @@ def test_fillcycle_ignore():
124124
ax.legend(loc='upper left')
125125

126126

127+
@image_comparison(baseline_images=['property_collision_plot'],
128+
remove_text=True, extensions=['png'])
129+
def test_property_collision_plot():
130+
fig, ax = plt.subplots()
131+
ax.set_prop_cycle('linewidth', [2, 4])
132+
for c in range(1, 4):
133+
ax.plot(np.arange(10), c * np.arange(10), lw=0.1)
134+
ax.plot(np.arange(10), 4 * np.arange(10))
135+
ax.plot(np.arange(10), 5 * np.arange(10))
136+
137+
138+
@image_comparison(baseline_images=['property_collision_fill'],
139+
remove_text=True, extensions=['png'])
140+
def test_property_collision_fill():
141+
fig, ax = plt.subplots()
142+
xs = np.arange(10)
143+
ys = 0.25 * xs**.5 + 2
144+
ax.set_prop_cycle(linewidth=[2, 3, 4, 5, 6], facecolor='bgcmy')
145+
for c in range(1, 4):
146+
ax.fill(xs, c * ys, lw=0.1)
147+
ax.fill(xs, 4 * ys)
148+
ax.fill(xs, 5 * ys)
149+
150+
127151
@cleanup
128152
def test_valid_input_forms():
129153
fig, ax = plt.subplots()

lib/matplotlib/tests/test_legend.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,15 @@ def test_legend_stackplot():
257257
ax.legend(loc=0)
258258

259259

260+
@cleanup
261+
def test_cross_figure_patch_legend():
262+
fig, ax = plt.subplots()
263+
fig2, ax2 = plt.subplots()
264+
265+
brs = ax.bar(range(3), range(3))
266+
fig2.legend(brs, 'foo')
267+
268+
260269
@cleanup
261270
def test_nanscatter():
262271
fig, ax = plt.subplots()

setupext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,7 +1089,7 @@ def do_custom_build(self):
10891089
try:
10901090
# this will fail on LPy, oh well
10911091
os.makedirs(tarball_cache_dir, exist_ok=True)
1092-
shutil.copy(tarball_cache_path, tarball_path)
1092+
shutil.copy(tarball_path, tarball_cache_path)
10931093
print('Cached tarball at: {}'
10941094
.format(tarball_cache_path))
10951095
except:

0 commit comments

Comments
 (0)