# Scale z plot3d

**URL:** <https://discourse.julialang.org/t/scale-z-plot3d/58953>\
**Category:** Visualization\
**Tags:** plotting\
**Created:** [April 9, 2021, 11:16pm UTC](https://discourse.julialang.org/t/scale-z-plot3d/58953 "2021-04-09T23:16:56Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![empet](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/empet/32/221303_2.png) [@empet](https://discourse.julialang.org/u/empet)\
**Post date:** [April 11, 2021, 4:35pm UTC](https://discourse.julialang.org/t/scale-z-plot3d/58953/3 "2021-04-11T16:35:35Z")

</div>

@angeloaliano1  
To customize both aspect ratio and plot aesthetics you can use PlotlyJS.jl:

```julia
using PlotlyJS
include("plotlyju.jl"); # style file: https://gist.github.com/empet/6b4f441ed96d724d67ff77f1fb8b0a79

f(x,y) = y < x ? cos(8x) + sin(8y) : NaN
xg = -2:0.02:2
z = [f.(x,y) for x in xg, y in xg];

trace = PlotlyJS.surface(x=xg, y =xg, z=z, 
                         colorbar_len=0.7)
pl = PlotlyJS.plot(trace, 
                   Layout(width=600, height=600,
                         scene_aspectratio=attr(x=1, y=1, z=0.5)), 
                   style=plotlyju)

```

 ![plot3d](https://global.discourse-cdn.com/julialang/original/3X/5/8/58b380c5aad59c0c5400d3f83ccdf91977cc8c94.jpeg)

---

_[View the full topic](https://discourse.julialang.org/t/scale-z-plot3d/58953)._
