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

Plots v1.11.0 breaks multi-coloured bar plots [BUG] #3623

Closed
sd109 opened this issue Jul 6, 2021 · 2 comments
Closed

Plots v1.11.0 breaks multi-coloured bar plots [BUG] #3623

sd109 opened this issue Jul 6, 2021 · 2 comments
Labels

Comments

@sd109
Copy link

sd109 commented Jul 6, 2021

Details

Creating a bar plot with different colours for each bar no longer works after v1.11.0 (but works correctly on v1.10.6). It just gives all bars the colour which is first in the colour list (i.e. blue in MWE below).

MWE:

]add Plots@1.11.0
using Plots
bar(ones(3), c=[:blue; :red; :green])

which outputs:

julia> Plots.bar(ones(3), c=[:blue; :red; :green])
┌ Warning: Indices Base.OneTo(3) of attribute `seriescolor` does not match data indices 1:17.
└ @ Plots ~/.julia/packages/Plots/isZEW/src/utils.jl:123
┌ Info: Data contains NaNs or missing values, and indices of `seriescolor` vector do not match data indices.
│ If you intend elements of `seriescolor` to apply to individual NaN-separated segements in the data,
│ pass each segment in a separate vector instead, and use a row vector for `seriescolor`. Legend entries
│ may be suppressed by passing an empty label.
│ For example,
└     plot([1:2,1:3], [[4,5],[3,4,5]], label=["y" ""], seriescolor=[1 2])
┌ Warning: Indices Base.OneTo(3) of attribute `fillcolor` does not match data indices 1:17.
└ @ Plots ~/.julia/packages/Plots/isZEW/src/utils.jl:123
┌ Info: Data contains NaNs or missing values, and indices of `fillcolor` vector do not match data indices.
│ If you intend elements of `fillcolor` to apply to individual NaN-separated segements in the data,
│ pass each segment in a separate vector instead, and use a row vector for `fillcolor`. Legend entries
│ may be suppressed by passing an empty label.
│ For example,
└     plot([1:2,1:3], [[4,5],[3,4,5]], label=["y" ""], fillcolor=[1 2])
┌ Warning: Indices Base.OneTo(3) of attribute `markercolor` does not match data indices 1:17.
└ @ Plots ~/.julia/packages/Plots/isZEW/src/utils.jl:123
┌ Info: Data contains NaNs or missing values, and indices of `markercolor` vector do not match data indices.
│ If you intend elements of `markercolor` to apply to individual NaN-separated segements in the data,
│ pass each segment in a separate vector instead, and use a row vector for `markercolor`. Legend entries
│ may be suppressed by passing an empty label.
│ For example,
└     plot([1:2,1:3], [[4,5],[3,4,5]], label=["y" ""], markercolor=[1 2])

The warnings disappear if we reshape the colour vector:

bar(ones(3), c=reshape([:blue, :red,  :green], 1, :))

but we still don't get the correct behaviour.

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pyplot x
plotly x
plotlyjs x
pgfplotsx x
inspectdr x

Versions

Plots.jl version: 1.11.0 onwards
Backend version (]st -m <backend(s)>): GR v0.55.0 & PyPlot v2.9.0
Output of versioninfo():
Julia Version 1.6.0
Commit f9720dc2eb (2021-03-24 12:55 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Core(TM) i7-8700T CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

@sd109 sd109 added the bug label Jul 6, 2021
@BeastyBlacksmith
Copy link
Member

probably caused by #3320

@BeastyBlacksmith
Copy link
Member

fixed in #3751

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

No branches or pull requests

2 participants