# Plotlyjs and composite figures

**URL:** <https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320>\
**Category:** General Usage\
**Tags:** plots, plotlyjs\
**Created:** [April 10, 2023, 9:35pm UTC](https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320 "2023-04-10T21:35:50Z")\
**Posts on this page:** 1\
**Showing post:** 6

<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 12, 2023, 6:36am UTC](https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320/6 "2023-04-12T06:36:47Z")

</div>

> [@rafael.guerra](#):
>
> as in the example above, the circle looks elliptical to me

In `PlotlyJS`, the relevant attributes (see [Single-page reference in Julia](https://plotly.com/julia/reference/)) for fixing the aspect ratio are `scaleanchor`, `scaleratio` and (not allowed simultaneously with these) `matches`:

```julia
p = Plot([heatmap(x=x, y=y, z=f, colorscale=colors.plasma,colorbar_thickness=24), 
               scatter(x=0.5*cos.(t), y=0.5*sin.(t), mode="lines",
                       line_width=2, line_color="black")],
               Layout(width=600, height=320, yaxis_scaleanchor="x", yaxis_scaleratio=1,
                      xaxis_range=[-2,2], yaxis_range=[-1,1]))

```

 ![ex](https://global.discourse-cdn.com/julialang/original/3X/8/2/82ed378a6807307ec7b5196110a1d1227a8705d5.png)

---

_[View the full topic](https://discourse.julialang.org/t/plotlyjs-and-composite-figures/97320)._
