# 3D Scatter with 2D Projections

**URL:** <https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920>\
**Category:** Visualization\
**Tags:** question, plotting\
**Created:** [April 23, 2022, 10:59pm UTC](https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920 "2022-04-23T22:59:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![MisterBiggs](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/misterbiggs/32/30722_2.png) [@MisterBiggs](https://discourse.julialang.org/u/MisterBiggs)\
**Post date:** [April 23, 2022, 10:59pm UTC](https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920/1 "2022-04-23T22:59:50Z")

</div>

Saw an interesting post on twitter [https://twitter.com/BrainInTheMind/status/1517543839833243649](https://twitter.com/BrainInTheMind/status/1517543839833243649) that got me wondering if there was a supported way to project 3D data onto the axes using Plots or Makie. I came up with my own solution:

```julia
let
	plot()
	scatter!(0 .* x, y, z, marker=:x, alpha=.6)
	scatter!(x, (0 .* y) .+ maximum(y), z, marker=:x, alpha=.6)
	scatter!(x, y, 0 .* z, marker=:x, alpha=.6)
	
	scatter!(x,y,z, legend=false)
end

```

Which feels super hacky but produces the correct results:

 ![brave_Qaq99inL8a](https://global.discourse-cdn.com/julialang/original/3X/4/1/4160aa8798defddd9ba72cc08a2ffa74fa6f92d7.png)

I was wondering if something like `scatter(x, y, z, project=true)` was supported to get the same result, or if it was possible to put other plots on the different planes such as a heatmap.

---

<div class="post-metadata">

**Author:** ![jd-foster](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jd-foster/32/35824_2.png) [@jd-foster](https://discourse.julialang.org/u/jd-foster)\
**Post date:** [April 24, 2022, 11:27pm UTC](https://discourse.julialang.org/t/3d-scatter-with-2d-projections/79920/2 "2022-04-24T23:27:04Z")

</div>

If you’re fine with using custom PlotlyJS features, you could use something like

> **[Scatter3d](https://plotly.com/javascript/reference/scatter3d/#scatter3d-projection)**
>
> Figure

General examples here: [3d · PlotlyJS](http://juliaplots.org/PlotlyJS.jl/stable/examples/3d/)  
but no examples for your specific case (yet).
