diff --git a/CHANGELOG.md b/CHANGELOG.md index 4d2c74a06..eab2a2292 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Unreleased +- Fixed aesthetics of `errorbar` so that x and y stay labelled correctly when using `direction = :x` [#560](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/560). - Added ability to specify `title`, `subtitle` and `footnotes` plus settings in the `draw` function [#556](https://github.com/MakieOrg/AlgebraOfGraphics.jl/pull/556). ## v0.8.7 - 2024-09-06 diff --git a/src/aesthetics.jl b/src/aesthetics.jl index 3e3bab05d..e13a5d4a5 100644 --- a/src/aesthetics.jl +++ b/src/aesthetics.jl @@ -252,14 +252,8 @@ function aesthetic_mapping(::Type{Errorbars}, i::Int) ]) ] dictionary([ - 1 => :direction => dictionary([ - :x => AesY, - :y => AesX, - ]), - 2 => :direction => dictionary([ - :x => AesX, - :y => AesY, - ]), + 1 => AesX, + 2 => AesY, 3 => :direction => dictionary([ :x => AesDeltaX, :y => AesDeltaY, diff --git a/test/reference_tests.jl b/test/reference_tests.jl index 756051f61..d06113278 100644 --- a/test/reference_tests.jl +++ b/test/reference_tests.jl @@ -196,27 +196,27 @@ reftest("rangebars cat color direction x") do end reftest("errorbars") do - data((; x = 1:4, y = 1:4, err = 2:5)) * mapping(:x, :y, :err) * + data((; x = ["A", "B", "C", "D"], y = 5:8, err = 2:5)) * mapping(:x, :y, :err) * visual(Errorbars) |> draw end reftest("errorbars direction x") do - data((; x = 1:4, y = 1:4, err = 2:5)) * mapping(:x, :y, :err) * + data((; x = ["A", "B", "C", "D"], y = 5:8, err = 2:5)) * mapping(:x, :y, :err) * visual(Errorbars; direction = :x) |> draw end reftest("errorbars cat color direction x") do - data((; x = 1:4, y = 1:4, err = 2:5, z = 1:4)) * mapping(:x, :y, :err, color = :z => nonnumeric) * + data((; x = ["A", "B", "C", "D"], y = 5:8, err = 2:5, z = 1:4)) * mapping(:x, :y, :err, color = :z => nonnumeric) * visual(Errorbars; direction = :x) |> draw end reftest("errorbars cat color") do - data((; x = 1:4, y = 1:4, err = 2:5, z = 1:4)) * mapping(:x, :y, :err, color = :z => nonnumeric) * + data((; x = ["A", "B", "C", "D"], y = 5:8, err = 2:5, z = 1:4)) * mapping(:x, :y, :err, color = :z => nonnumeric) * visual(Errorbars) |> draw end reftest("errorbars low high") do - data((; x = 1:4, y = 1:4, errlow = [0.1, 0.2, 0.3, 0.4], errhigh = [0.4, 0.2, 0.3, 0.1])) * mapping(:x, :y, :errlow, :errhigh) * + data((; x = ["A", "B", "C", "D"], y = 5:8, errlow = [0.1, 0.2, 0.3, 0.4], errhigh = [0.4, 0.2, 0.3, 0.1])) * mapping(:x, :y, :errlow, :errhigh) * visual(Errorbars) |> draw end diff --git a/test/reference_tests/errorbars cat color direction x ref.png b/test/reference_tests/errorbars cat color direction x ref.png index c88b5a606..b1b6547d4 100644 Binary files a/test/reference_tests/errorbars cat color direction x ref.png and b/test/reference_tests/errorbars cat color direction x ref.png differ diff --git a/test/reference_tests/errorbars cat color ref.png b/test/reference_tests/errorbars cat color ref.png index aa6b77505..f438f4ef3 100644 Binary files a/test/reference_tests/errorbars cat color ref.png and b/test/reference_tests/errorbars cat color ref.png differ diff --git a/test/reference_tests/errorbars direction x ref.png b/test/reference_tests/errorbars direction x ref.png index 2b93bb5e6..9bf58291f 100644 Binary files a/test/reference_tests/errorbars direction x ref.png and b/test/reference_tests/errorbars direction x ref.png differ diff --git a/test/reference_tests/errorbars low high ref.png b/test/reference_tests/errorbars low high ref.png index 9766aa878..526bab227 100644 Binary files a/test/reference_tests/errorbars low high ref.png and b/test/reference_tests/errorbars low high ref.png differ diff --git a/test/reference_tests/errorbars ref.png b/test/reference_tests/errorbars ref.png index 3b3532fc3..8808f7076 100644 Binary files a/test/reference_tests/errorbars ref.png and b/test/reference_tests/errorbars ref.png differ