How can I move the x axis and ticks at top of the graph?

Hi all! I’m trying to plot a heatmap of a distance matrix:

julia> distance_matrix_measures
12×12 Matrix{Float64}:
 0.0         0.0242429   0.0217801   …  0.0443951   0.0124709   0.0114215
 0.0242429   0.0         0.00246275     0.068638    0.0117719   0.0128213
 0.0217801   0.00246275  0.0            0.0661752   0.00930917  0.0103586
 0.0460765   0.0703193   0.0678566      0.00168135  0.0585474   0.057498
 0.00384102  0.0204018   0.0179391      0.0482362   0.00862992  0.00758049
 0.00412733  0.0201155   0.0176528   …  0.0485225   0.00834362  0.00729419
 0.00651857  0.0307614   0.0282987      0.0378766   0.0189895   0.0179401
 0.0316369   0.00739405  0.00985679     0.076032    0.019166    0.0202154
 0.0270464   0.00280358  0.00526632     0.0714416   0.0145755   0.0156249
 0.0443951   0.068638    0.0661752      0.0         0.0568661   0.0558166
 0.0124709   0.0117719   0.00930917  …  0.0568661   0.0         0.00104943
 0.0114215   0.0128213   0.0103586      0.0558166   0.00104943  0.0

julia> heatmap(
           [t.program for t in results],
           [t.program for t in results],
           distance_matrix_measures,
           c=cgrad([:green, :yellow, :red]),
           title="Differences between measured programs",
           aspect_ratio = :equal, yflip = true,
           xrotation = 90,
           #grid = false, axis= false, ticks = true
       )

obtaining:
plot

Here’s the thing: since I reversed the y axis to have the plot consistent with how you’d write down numerically the matrix, I’d also like to move the x axis at the top. How can I do that? I’m on Plots.jl with GR backend.

Thanks!

Check the keyword xmirror=true

1 Like

Thanks!