# Makie - 3d plot with positive Z axis pointing down?

**URL:** <https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544>\
**Category:** Visualization\
**Tags:** question, plotting, makie, 3d\
**Created:** [August 7, 2023, 4:59am UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544 "2023-08-07T04:59:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Undermine28](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/undermine28/32/52092_2.png) [@Undermine28](https://discourse.julialang.org/u/Undermine28)\
**Post date:** [August 7, 2023, 4:59am UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/1 "2023-08-07T04:59:48Z")

</div>

I am trying to visualize an aircraft trajectory. We define the local z vector as down.

I see how to do this in the 2d axis but no options to invert the Z axis in Axis3.

Basically, I am hoping to have the Z-axis positive down and the x and y axis do not matter as long as they conform to a right-handed coordinate system. I also assume I can still easily adjust x and y orientation using the elevation and azimuth commands.

For reference, here is the data plotting as is. The aircraft is physically diving downwards (in a positive z direction) starting from level flight in the origin.

 ![Test Image](https://global.discourse-cdn.com/julialang/original/3X/3/7/37f5f011a4fed1eb674773fc4009a33cc6c0fb67.jpeg)

Any help would be greatly appreciated.

---

<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:** [August 7, 2023, 5:47am UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/2 "2023-08-07T05:47:04Z")

</div>

I think I have not implemented axis flips for Axis3, yet. In principle it’s not difficult, it’s mostly a sign flip in some projection matrix. Maybe file an issue so we can keep track of it? If you’re willing to take a stab at it yourself I could try to help you as well if you get stuck

---

<div class="post-metadata">

**Author:** ![berjine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/berjine/32/51764_2.png) [@berjine](https://discourse.julialang.org/u/berjine)\
**Post date:** [August 7, 2023, 8:21am UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/3 "2023-08-07T08:21:59Z")

</div>

You could modify the zticks while displaying the points with inverted z-coordinates, like that for example

```julia
(x,y,z) = (rand(5),rand(5),rand(5))

(zmin, zmax, zstep) = (0.0, 1.0, 0.5)

f = Figure()
ax = Axis3(f[1,1],
    zticks = (collect(-zmax:zstep:zmin), map(x->"$x",collect(zmax:-zstep:zmin)))
    )

lines!(ax,x,y,-z)

xlims!(ax,(0.0,1.0))
ylims!(ax,(0.0,1.0))
zlims!(ax,(-zmax,zmin))
f

```

---

<div class="post-metadata">

**Author:** ![Undermine28](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/undermine28/32/52092_2.png) [@Undermine28](https://discourse.julialang.org/u/Undermine28)\
**Post date:** [August 8, 2023, 3:00pm UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/4 "2023-08-08T15:00:18Z")

</div>

Ah, okay, thanks! I will open an issue and see if I can figure it out, cheers.

---

<div class="post-metadata">

**Author:** ![Undermine28](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/undermine28/32/52092_2.png) [@Undermine28](https://discourse.julialang.org/u/Undermine28)\
**Post date:** [August 8, 2023, 3:12pm UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/5 "2023-08-08T15:12:46Z")

</div>

I think this could work for a short workaround, I’ll be needing to do a lot of plotting, and it is critical that the plots stay properly in the coordinate systems, so I cannot afford to only flip one axis. Thanks for the work around though!

---

<div class="post-metadata">

**Author:** ![berjine](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/berjine/32/51764_2.png) [@berjine](https://discourse.julialang.org/u/berjine)\
**Post date:** [August 8, 2023, 3:20pm UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/6 "2023-08-08T15:20:52Z")

</div>

I guess you could define a specific recipe to easily make a lot of plots, though I have never done that

---

<div class="post-metadata">

**Author:** ![Undermine28](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/undermine28/32/52092_2.png) [@Undermine28](https://discourse.julialang.org/u/Undermine28)\
**Post date:** [August 8, 2023, 6:08pm UTC](https://discourse.julialang.org/t/makie-3d-plot-with-positive-z-axis-pointing-down/102544/7 "2023-08-08T18:08:37Z")

</div>

I have made an issue and tried to make it somewhat informative.

I started digging and think I’m pretty far out of my depth on creating pull request to implement the feature myself. I am pretty new to Julia and not sure where I would start to implement such a feature. Any tips?

Here is the issue: [zreversed feature in Axis3 · Issue #3137 · MakieOrg/Makie.jl · GitHub](https://github.com/MakieOrg/Makie.jl/issues/3137)
