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

Only label vertical lines in acorr #9945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Dec 7, 2017
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 2 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 BIN +1.02 KB (110%) 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 3 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
Morty Proxy This is a proxified and sanitized view of the page, visit original site.