You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
categories can be passed to scales to show empty categories too. This usually works. However, if the empty categories come before the existing categories in the passed list it does not work.
Steps to reproduce
using AlgebraOfGraphics
using CairoMakie
spec = data((; group = ["B", "C", "D"], value = [1, 3, 4])) *
mapping(:group, :value) * visual(BarPlot)
fig = Figure()
draw!(fig[1, 1], spec, scales(
X = (; categories = ["A", "B", "C", "D"])
))
fig
Images
Version info
Julia Version 1.11.3
Commit d63adeda50d (2025-01-21 19:42 UTC)
Build Info:
Official https://julialang.org/ release
Platform Info:
OS: macOS (arm64-apple-darwin24.0.0)
CPU: 10 × Apple M1 Max
WORD_SIZE: 64
LLVM: libLLVM-16.0.6 (ORCJIT, apple-m1)
Threads: 8 default, 0 interactive, 4 GC (on 8 virtual cores)
Environment:
JULIA_REVISE_WORKER_ONLY = 1
Status `~/Documents/PhD/NI/Lehre_PPR/Exam_Summary/Project.toml`
[cbdf2221] AlgebraOfGraphics v0.10.0
[336ed68f] CSV v0.10.15
[13f3f980] CairoMakie v0.13.2
[a93c6f00] DataFrames v1.7.0
⌃ [7f904dfe] PlutoUI v0.7.61
[37e2e46d] LinearAlgebra v1.11.0
Info Packages marked with ⌃ have new versions available and may be upgradable.```
The text was updated successfully, but these errors were encountered:
The problem here is that Makie sets the limits more tightly than you want, not that the categories themselves don't exist in the ticks. I've been wondering if AlgebraOfGraphics should enforce a minimal range of limits for categorical scales for that reason. Maybe this could be done by adding an invisible plot there.
Okay, I just adjusted the lower limit of CairoMakie.xlims! to 0. However, I think this should happen automatically when categories are passed. Would be a great addition for the future.
Bug description
categories
can be passed toscales
to show empty categories too. This usually works. However, if the empty categories come before the existing categories in the passed list it does not work.Steps to reproduce
Images
Version info
The text was updated successfully, but these errors were encountered: