# How to make xylabel LaTeXString with ternary operator?

**URL:** <https://discourse.julialang.org/t/how-to-make-xylabel-latexstring-with-ternary-operator/93626>\
**Category:** Visualization\
**Tags:** makie, latexstrings\
**Created:** [January 27, 2023, 12:03pm UTC](https://discourse.julialang.org/t/how-to-make-xylabel-latexstring-with-ternary-operator/93626 "2023-01-27T12:03:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![YH\_Ko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yh_ko/32/45438_2.png) [@YH\_Ko](https://discourse.julialang.org/u/YH_Ko)\
**Post date:** [January 27, 2023, 12:03pm UTC](https://discourse.julialang.org/t/how-to-make-xylabel-latexstring-with-ternary-operator/93626/1 "2023-01-27T12:03:13Z")

</div>

I’m trying to visualize contour over heatmap example of Makie from following reference.

> **[Contour over heatmap - Beautiful Makie](https://beautiful.makie.org/dev/examples/generated/2d/contour/contour_over_heatmap/)**
>
> Makie Examples

 ![캡처](https://global.discourse-cdn.com/julialang/original/3X/1/7/17f9c1fabb3c064e38cc75471a4d67371bdecaf8.png)

Here, I want to change xlabel and ylabel to LaTexString style.  
[original code]  
axs = [Axis(fig[1, j], aspect=1, xlabel=“x”, ylabel=j == 1 ? “y” : “”) for j in 1:3]

[my code]  
axs = [Axis(fig[1, j], aspect=1, xlabel=“x”, ylabel=j == 1 ? L"y" :L “”) for j in 1:3]

However, I got error message like this.  
ERROR: MethodError: no method matching MathTeXEngine.Group(::Vector{Any}, ::Vector{Point{2, Float32}}, ::Vector{Float64})

Any ideas??

---

<div class="post-metadata">

**Author:** ![YH\_Ko](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yh_ko/32/45438_2.png) [@YH\_Ko](https://discourse.julialang.org/u/YH_Ko)\
**Post date:** [January 27, 2023, 12:10pm UTC](https://discourse.julialang.org/t/how-to-make-xylabel-latexstring-with-ternary-operator/93626/2 "2023-01-27T12:10:33Z")

</div>

I only changed like below and it works.  
axs = [Axis(fig[1, j], aspect=1, xlabel=“x”, ylabel=j == 1 ? L"y" : “ ”) for j in 1:3]

I don’t know why ylabel = L" " isn’t allowed.

---

<div class="post-metadata">

**Author:** ![jules](https://avatars.discourse-cdn.com/v4/letter/j/41988e/32.png) [@jules](https://discourse.julialang.org/u/jules)\
**Post date:** [January 27, 2023, 1:12pm UTC](https://discourse.julialang.org/t/how-to-make-xylabel-latexstring-with-ternary-operator/93626/3 "2023-01-27T13:12:09Z")

</div>

Probably an edge case with type instability in MathTeXEngine.jl given that there seems to be an Any array involved
