# Problem using subplots in PLotlyJS

**URL:** <https://discourse.julialang.org/t/problem-using-subplots-in-plotlyjs/75226>\
**Category:** New to Julia\
**Tags:** plotting, plotlyjs\
**Created:** [January 26, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-using-subplots-in-plotlyjs/75226 "2022-01-26T12:59:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![pafloxy](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/pafloxy/32/28694_2.png) [@pafloxy](https://discourse.julialang.org/u/pafloxy)\
**Post date:** [January 26, 2022, 12:59pm UTC](https://discourse.julialang.org/t/problem-using-subplots-in-plotlyjs/75226/1 "2022-01-26T12:59:33Z")

</div>

I’m having problem rendering plots in PlotlyJS  
as follows

```plaintext
p1 = plot(tr[:,1],tr[:,2],tr[:,3])
p2 = plot(tr[:,2], tr[:,3],tr[:,4])
p = [p1; p2]

```

This code yields the following result

 ![image](https://global.discourse-cdn.com/julialang/original/3X/e/0/e0edb2966a444947330a272554bea59f75c9abb3.png)

---

<div class="post-metadata">

**Author:** ![rafael.guerra](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rafael.guerra/32/216610_2.png) [@rafael.guerra](https://discourse.julialang.org/u/rafael.guerra)\
**Post date:** [January 26, 2022, 3:36pm UTC](https://discourse.julialang.org/t/problem-using-subplots-in-plotlyjs/75226/2 "2022-01-26T15:36:04Z")

</div>

Look at `PlotlyJS.jl`’s [3D line plot examples here](https://plotly.com/julia/3d-line-plots/).

> **example**
>
> ```julia
> using PlotlyJS
> tr = [rand(10) rand(10) rand(10) rand(10)] 
> 
> p1 = plot(scatter(x = tr[:,1], y = tr[:,2], z = tr[:,3],
> marker=attr(size=4, color= :red), type="scatter3d", mode=mode="lines+markers")
> );
> p2 = plot(scatter(x = tr[:,2], y = tr[:,3], z = tr[:,4],
> marker=attr(size=4, color= :blue), type="scatter3d", mode=mode="lines+markers")
> );
> p = [p1; p2]
> 
> ```
