# How to add axis labels, color bar, and marker shape to TernaryDiagrams?

**URL:** https://discourse.julialang.org/t/how-to-add-axis-labels-color-bar-and-marker-shape-to-ternarydiagrams/116513
**Category:** Performance
**Tags:** question, plotting, makie
**Created:** [July 2, 2024, 10:26am UTC](https://discourse.julialang.org/t/how-to-add-axis-labels-color-bar-and-marker-shape-to-ternarydiagrams/116513 "2024-07-02T10:26:46Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)
#### Post date: [July 2, 2024, 10:26am UTC](https://discourse.julialang.org/t/how-to-add-axis-labels-color-bar-and-marker-shape-to-ternarydiagrams/116513/1 "2024-07-02T10:26:46Z")

</div>

Hello,

I have two data sets that I would like to represent as a 3-simplex. My goal is to plot the first 3 dimensions as a ternary diagram with TernaryDiagrams.jl and represent the fourth dimension with a color gradient. I would also like to denote the two datasets with a different marker shape. I am having trouble getting the axis labels to display, the marker to change, and the colorbar to display. Here is what I have so far:

```julia
using Makie 
using GLMakie 
using TernaryDiagrams
using Distributions
using ColorSchemes 

fig = Figure();
ax = Axis(fig[1, 1]);

ternaryaxis!(ax; labelx = "1", labely = "2", labelz = "3");

data1 = rand(Dirichlet([5,1,1,10]), 10)'
data2 = rand(Dirichlet([1,5,1,1]), 10)'
ternaryscatter!(
    ax,
    data1[:,1],
    data1[:,2],
    data1[:,3],
    color = [get(ColorSchemes.Spectral, w, extrema(data1[:,4])) for w in data1[:,4]],
    marker = :circle,
    markersize = 20
)

ternaryscatter!(
    ax,
    data2[:,1],
    data2[:,2],
    data2[:,3],
    color = [get(ColorSchemes.Spectral, w, extrema(data2[:,4])) for w in data2[:,4]],
    marker = :triangle,
    markersize = 20
)
fig

```

Any help would be greatly appreciated.
