Skip to content

Empty categories are not shown if proceed existing categories #635

Closed
@h-spiess

Description

@h-spiess

Bug description

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

Image

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.```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions