Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cc3a708

Browse filesBrowse files
committed
Add legend to acorr image test
1 parent 72b06a3 commit cc3a708
Copy full SHA for cc3a708

File tree

Expand file treeCollapse file tree

3 files changed

+3
-2
lines changed
Filter options
Expand file treeCollapse file tree

3 files changed

+3
-2
lines changed

‎lib/matplotlib/axes/_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/axes/_axes.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1760,7 +1760,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
17601760
if usevlines:
17611761
a = self.vlines(lags, [0], correls, **kwargs)
17621762
# Make label empty so only vertical lines get a legend entry
1763-
kwargs['label'] = ''
1763+
kwargs.pop('label', '')
17641764
b = self.axhline(**kwargs)
17651765
else:
17661766
kwargs.setdefault('marker', 'o')
Loading

‎lib/matplotlib/tests/test_axes.py

Copy file name to clipboardExpand all lines: lib/matplotlib/tests/test_axes.py
+2-1Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,8 @@ def test_acorr():
5151
x = np.random.normal(0, 1, n).cumsum()
5252

5353
fig, ax = plt.subplots()
54-
ax.acorr(x, maxlags=n - 1)
54+
ax.acorr(x, maxlags=n - 1, label='acorr')
55+
ax.legend()
5556

5657

5758
@image_comparison(baseline_images=['spy'], extensions=['png'], style='mpl20')

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.