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] When using permute = (:x, :y) on a bar plot the bars are not automatically centered #4949

Open
georgemetzger opened this issue Jun 20, 2024 · 1 comment
Labels

Comments

@georgemetzger
Copy link

Details

When plotting a horizontal bar plot with permute the plot is not centered; the bars run to the edges and bar_edges does not seem to have any effect. Plots can be adjusted with ylims! but this would become tedious when refreshing data or making new plots.

plot

Backends

This bug occurs on ( insert x below )

Backend yes no untested
gr (default) x
pythonplot x
plotlyjs x
pgfplotsx x
unicodeplots x
inspectdr x
gaston x

Versions

Plots.jl version: v1.40.4
Backend version (]st -m <backend(s)>):
Output of versioninfo():
Julia Version 1.10.3
Commit 0b4590a550 (2024-04-30 10:59 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 20 × 13th Gen Intel(R) Core(TM) i7-1370P
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-15.0.7 (ORCJIT, goldmont)
Threads: 1 default, 0 interactive, 1 GC (on 20 virtual cores)
Environment:
JULIA_EDITOR = code
JULIA_NUM_THREADS =

@Jonas-a-Zimmermann
Copy link

This error arrises due to the permutation not correctly permuting the widen tags of the axis.
The widen tags are set during the recipe pipeline, and set to auto for the xaxis and false for the yaxis, however the axis do get switched due to the permute.
For now a workaround is to pass
plt = histrogram(x; permute(:x, :y), widen=false) (easiest)
or
plt = histogram(x; permute=(:x, :y), ywiden=false, xwiden=true) (contains the permutation bug; prob. breaks once the bug is fixed)

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