# Plot DataFrames columns in plotlyjs

**URL:** <https://discourse.julialang.org/t/plot-dataframes-columns-in-plotlyjs/55333>\
**Category:** Visualization\
**Tags:** plotting, dataframes, plotlyjs\
**Created:** [February 15, 2021, 4:27pm UTC](https://discourse.julialang.org/t/plot-dataframes-columns-in-plotlyjs/55333 "2021-02-15T16:27:18Z")\
**Posts on this page:** 1\
**Showing post:** 13

<div class="post-metadata">

**Author:** ![VivMendes](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/vivmendes/32/16477_2.png) [@VivMendes](https://discourse.julialang.org/u/VivMendes)\
**Post date:** [January 8, 2022, 7:10pm UTC](https://discourse.julialang.org/t/plot-dataframes-columns-in-plotlyjs/55333/13 "2022-01-08T19:10:14Z")

</div>

Hi. Sorry for such a late entry into this issue. I have been trying to adapt @empet’s solution to the case of a matrix, instead of a data frame. Not surprisingly, I failed.

My problem is simple. I have a loop that produces a `400×7 Matrix{Float64}:` matrix, and I want to come up with a scatter plot of those 7 columns against an array of `400×7 Matrix{Float64}:`. As one can see in the figure below, I can easily do it.

The problem I am facing is that I need to name the traces according to the entries of another `Float{64}` array: `y_grid = [0.25 , 0.4 , 0.6 , 0.9 , 1.3 , 2.0 , 3.0]`. I can do it trace by trace, but this is ugly and terribly inefficient.

I know how to do it in Plots, but I am migrating all my teaching stuff into PlotlyJS. I am also using Pluto and have no compatibility problems between the former and PlotlyJS due to the workaround developed by @disberd[here](https://discourse.julialang.org/t/pluto-plots-with-plotlybase-plotlyjs-with-working-static-html-export/61730/2).

Help will be very much appreciated. Thanks.

 ![aa](https://global.discourse-cdn.com/julialang/original/3X/9/4/949bd17cba18a7fb057ac06a15313745c61a463e.png)

---

_[View the full topic](https://discourse.julialang.org/t/plot-dataframes-columns-in-plotlyjs/55333)._
