AlgebraOfGraphics.jl
AlgebraOfGraphics.jl copied to clipboard
`renamer` and `LaTeXStrings`
Bug description
LaTeXStrings are not rendered correctly when used with renamer.
Steps to reproduce
Normally LaTeXStrings are rendered correctly, like here:
using AlgebraOfGraphics
using CairoMakie
using LaTeXStrings
ws = [1e-8, 0.5, 1]
plot = data((x=[1, 2, 3], w=ws)) * mapping(:x) * histogram()
draw(plot * mapping(row = :w => (x -> LaTeXString("\$w = $x\$"))))
But when one has to reorder legends or facet entries with renamer or sorter they are not:
using AlgebraOfGraphics
using CairoMakie
using LaTeXStrings
ws = [1e-8, 0.5, 1]
plot = data((x=[1, 2, 3], w=ws)) * mapping(:x) * histogram()
order = renamer([w => LaTeXString("\$w = $w\$") for w in ws])
draw(plot * mapping(row = :w => order))
Version info
Status `/tmp/jl_v1KZbO/Project.toml`
[cbdf2221] AlgebraOfGraphics v0.6.16
[13f3f980] CairoMakie v0.10.6
[b964fa9f] LaTeXStrings v1.3.0
[44cfe95a] Pkg v1.9.0
Julia Version 1.9.1
Commit 147bdf428cd (2023-06-07 08:27 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: 4 × Intel(R) Core(TM) i5-6300U CPU @ 2.40GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-14.0.6 (ORCJIT, skylake)
Threads: 2 on 4 virtual cores
Environment:
JULIA_IMAGE_THREADS = 1
JULIA_DEPOT_PATH =.julia:/usr/local/share/julia:/usr/share/julia
JULIA_LOAD_PATH = @:@v#.#:@stdlib
JULIA_REVISE_WORKER_ONLY = 1