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

[BUG] bar example is broken with GR backend: colors do not show up properly #3424

Closed
mroavi opened this issue Apr 8, 2021 · 3 comments
Closed
Labels

Comments

@mroavi
Copy link

mroavi commented Apr 8, 2021

Details

The example presented in bar's help seems to be broken: the specified colors do not show up properly.

Minimal example:

❯ julia
               _
   _       _ _(_)_     |  Documentation: https://docs.julialang.org
  (_)     | (_) (_)    |
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 1.6.0 (2021-03-24)
 _/ |\__'_|_|_|\__'_|  |
|__/                   |

julia> using Plots

help?> bar
search: bar barh bar! barh! barhist barhist! baremodule SubArray GlobalRef clipboard BitArray backtrace rgba_string BitMatrix catch_backtrace AbstractRGB AbstractRGBA AbstractRange AbstractGray AbstractArray

  bar(x,y)
  bar!(x,y)


  Make a bar plot of y vs x.

  Arguments
  ≡≡≡≡≡≡≡≡≡≡≡

    •  bar_position: Symbol. Choose from :overlay (default), :stack. (warning: May not be implemented fully)

    •  bar_width: nothing or Number. Width of bars in data coordinates. When nothing, chooses based on x (or y when orientation = :h).

    •  bar_edges: Bool. Align bars to edges (true), or centers (the default)?

    •  orientation: Symbol. Horizontal or vertical orientation for bar types. Values :h, :hor, :horizontal correspond to horizontal (sideways, anchored to y-axis), and :v, :vert, and :vertical correspond to
       vertical (the default).

  Examples
  ≡≡≡≡≡≡≡≡≡≡

  julia> bar([1,2,3],[4,5,6],fillcolor=[:red,:green,:blue],fillalpha=[0.2,0.4,0.6])
  julia> bar([(1,4),(2,5),(3,6)])


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

Plot:
image

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: [91a5bcdd] Plots v1.11.2
Backend version (]st -m): [28b8d3ca] GR v0.57.1
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-8550U CPU @ 1.80GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-11.0.1 (ORCJIT, skylake)

@mroavi mroavi added the bug label Apr 8, 2021
@bvolkmer
Copy link

bvolkmer commented Apr 8, 2021

This bug was introduced in version v1.11.0. In version v1.10.6 it works.

@daisy12321
Copy link

Bump this issue. The bug is bisected to this commit: 42b3c56

@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

4 participants