Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add legend to acorr image test
  • Loading branch information
dstansby committed Dec 6, 2017
commit cc3a708398a05af96d88dac87d4035d3b848add2
2 changes: 1 addition & 1 deletion lib/matplotlib/axes/_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -1760,7 +1760,7 @@ def xcorr(self, x, y, normed=True, detrend=mlab.detrend_none,
if usevlines:
a = self.vlines(lags, [0], correls, **kwargs)
# Make label empty so only vertical lines get a legend entry
kwargs['label'] = ''
kwargs.pop('label', '')
b = self.axhline(**kwargs)
else:
kwargs.setdefault('marker', 'o')
Expand Down
Binary file modified lib/matplotlib/tests/baseline_images/test_axes/acorr.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion lib/matplotlib/tests/test_axes.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def test_acorr():
x = np.random.normal(0, 1, n).cumsum()

fig, ax = plt.subplots()
ax.acorr(x, maxlags=n - 1)
ax.acorr(x, maxlags=n - 1, label='acorr')
ax.legend()


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