# Permute x and y axes of a \`Makie.Axis\`

**URL:** <https://discourse.julialang.org/t/permute-x-and-y-axes-of-a-makie-axis/67826>\
**Category:** Visualization\
**Tags:** makie\
**Created:** [September 7, 2021, 6:34pm UTC](https://discourse.julialang.org/t/permute-x-and-y-axes-of-a-makie-axis/67826 "2021-09-07T18:34:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [September 7, 2021, 6:34pm UTC](https://discourse.julialang.org/t/permute-x-and-y-axes-of-a-makie-axis/67826/1 "2021-09-07T18:34:36Z")

</div>

[This example](https://makie.juliaplots.org/v0.15.2/examples/layoutables/axis/index.html#setting_axis_limits_and_reversing_axes) shows how to reverse the direction of the x- and y-axis. However, I am interested in plotting the first coordinate of data along the vertical axis, and the second coordinate of data along the horizontal axis, in effect swapping x and y.

Said differently, I would like something so that

```julia
using Makie: Figure, Axis, lines!
fig = Figure()
ax = Axis(fig[1, 1]) # some code here to modify `ax`
lines!(ax, [(0,0), (0, 1)])

```

produces a horizontal line, instead of a vertical line.

I am aware that I could instead plot `[(0, 0), (1, 0)]`, but I am looking for an alternative to that.

---

<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:** [September 7, 2021, 8:15pm UTC](https://discourse.julialang.org/t/permute-x-and-y-axes-of-a-makie-axis/67826/2 "2021-09-07T20:15:40Z")

</div>

Not possible with Axis, it’s just been too much work to make that whole machinery flexible enough to flip the axes. With a simple `Scene` it’s possible to flip the transform.

---

<div class="post-metadata">

**Author:** ![goretkin](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goretkin/32/167_2.png) [@goretkin](https://discourse.julialang.org/u/goretkin)\
**Post date:** [September 7, 2021, 8:21pm UTC](https://discourse.julialang.org/t/permute-x-and-y-axes-of-a-makie-axis/67826/3 "2021-09-07T20:21:21Z")

</div>

Thanks for the reply. I have been playing around with transforming parts of the scene graph (e.g. the code at [https://github.com/JuliaPlots/Makie.jl/issues/1298](https://github.com/JuliaPlots/Makie.jl/issues/1298)) and was trying now to figure out if I can modify the transform of a camera.

Is it possible to flip the whole `Scene` (in my example `fig.scene`, I believe)? And separately, is it possible to keep the text aligned?

`fig.scene.children[1].camera.projection` does not affect the whole axis, but just the contents, I think. Is there anything else I could play around with?
