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
[BUG] Wrong labels when combining series recipe with subplots #4668
Comments
I looked into this and I think the issue too complex to try to solve for a newbie (like me, haha). Though I'll still share what I found. Line 343 in 511784f
and slicing argument arrays ( Line 2005 in 511784f
It does so by iterating over each Lines 302 to 303 in 511784f
Since :series_plotindex is 1...3 and there are 3 label items at the start, slicing works.
Now let's run the "recipe" code, slicing will process both subplots at the same time
and when it tries to compute Lines 1655 to 1660 in 511784f
mod1.([3,4,5],3) = [3,1,2] , slicing :labels into ["b4", "b2", "b3"] seen in the bug report legend.
I tried to "fix" this by filtering Plots.jl/test/test_components.jl Lines 240 to 247 in 511784f
Hope that would help, maybe @t-bltg can tag somebody who can help. |
Thank you for sharing these insights!
|
most likely related to #4108 |
I take it from the other issue that the workaround is to plot every line by its own.
While not as convenient, this works. Thanks! |
I observed a problem with the label order when creating subplots in a recipe.
It happens when the number of lines is different between the subplots. The lines seem right but the label order in the legend is messed up.
Details
It works with normal code:
And I would expect to get the same result with this recipe but the labels are wrong:
Note that the color order is identical but the labels of the second plot are interchanged.
Backends
This bug occurs on ( insert
x
below )Versions
Plots.jl version:
v1.38.5
Backend version (
]st -m <backend(s)>
):Output of
versioninfo()
:Julia Version 1.8.5
Commit 17cfb8e65e (2023-01-08 06:45 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 8 × 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
Threads: 8 on 8 virtual cores
Environment:
JULIA_EDITOR = code
Edit: updated to fit the template, don't know why it was not shown before.
The text was updated successfully, but these errors were encountered: