# Plotly and graphplot

**URL:** <https://discourse.julialang.org/t/plotly-and-graphplot/42379>\
**Category:** New to Julia\
**Created:** [July 1, 2020, 3:48pm UTC](https://discourse.julialang.org/t/plotly-and-graphplot/42379 "2020-07-01T15:48:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![erlebach](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/erlebach/32/12973_2.png) [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Post date:** [July 1, 2020, 3:48pm UTC](https://discourse.julialang.org/t/plotly-and-graphplot/42379/1 "2020-07-01T15:48:21Z")

</div>

I would like to plot and rotate with the mouse a 3D `SimpleGraph` from `LightGraphs.jl`. Here is MWE:

```julia
using LightGraphs
using GraphRecipes
import Plots
Plots.PlotlyBackend()

function plotGraph()
    graph = SimpleGraph(20, 100)
    nb_nodes = nv(graph)
    xx = rand(nb_nodes)
    yy = rand(nb_nodes)
    zz = rand(nb_nodes)
    p = graphplot(graph, x=xx, y=yy, z=zz)
end

Plots.pyplot()
Plots.plotly()p = plotGraph()

```

I see the `plotly` widgets, but I cannot rotate the plot. When I hover the mouse over the nodes, I only see the `x,y` coordinates of the nodes, leading me to believe that the `z` coordinate is ignored.

To make sure I was using `plotly` properly, I tried the following example, which allowed me to rotate in 3D. What am I missing? Thanks.

```julia
import Plots
Plots.PlotlyBackend()
n = 100
ts = range(0, stop = 8π, length = n)
x = ts .* map(cos, ts)
y = (0.1ts) .* map(sin, ts)
z = 1:n
Plots.plot(x, y, z, zcolor = reverse(z), m = (10, 0.8, :blues, Plots.stroke(0)), leg = false, cbar = true, w = 5)
Plots.plot!(zeros(n), zeros(n), 1:n, w = 10)

```

Never mind. I forgot to add an argument `dim=3` in `graphplot`. The graph now rotates nicely in 3D! False alarm.There is still an issue. See next post.
