Skip to content
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

twinx() doesn't combine legends #2416

Closed
ssfrr opened this issue Feb 25, 2020 · 1 comment
Closed

twinx() doesn't combine legends #2416

ssfrr opened this issue Feb 25, 2020 · 1 comment

Comments

@ssfrr
Copy link

ssfrr commented Feb 25, 2020

It looks like when twinx() is used the legend for the 2nd plot is displayed over the top of the legend for the first plot:

MWE:

using Plots
plot(randn(10), label="First")
plot!(twinx(), randn(10), label="Second")

You can confirm by setting legend=:bottomright in the first plot call.

Currently I'm using this workaround:

plot(randn(10), legend=false)
plot!(twinx(), [fill(NaN, 10) randn(10)], label=["First" "Second"])
@ssfrr
Copy link
Author

ssfrr commented Feb 28, 2020

whoops, sorry for the duplicate issues. This was during the github down-time so I kept getting errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants