Intro to Julia course: Plotting: plotlyjs yields blank?

Hi, during the lecture on plotting, Plotting | JuliaAcademy (ca. 3 minutes in), she switches over to the plotlyjs() backend.
When I try that, I get only a blank area instead of a plot.
This is whether I use the “pirates” example, or the “x^2” example, as in:

using Plots
x = -10:10
y = x.^2
plot(x,y, label="line")
scatter!(x,y, label="scatter")

If I do the gr() backend it works fine, but with plotlyjs() it’s just a big blank space.

Earlier I was getting an error message about the WebIO extension not being installed, but I exited jupyter lab, went to my shell, ran python3 -m pip install --upgrade webio_jupyter_extension, restarted jupyter lab, re-ran the notebook, and then the error went away, and now I just see a big blank space.

How to fix this?

Btw, as per the troubleshooting instructions, here’s the check that the webio extension is installed:

$ jupyter labextension list
JupyterLab v3.2.7
        webio-jupyterlab-provider v0.1.0 enabled OK (python, webio_jupyter_extension)
        @jupyter-widgets/jupyterlab-manager v3.0.1 enabled OK (python, jupyterlab_widgets)

I’m not using any --user pip installations, and I made sure to install the webio extension and run jupyterlab in the same environment:

python3 -m pip install webio_jupyter_extension
python3 -m jupyterlab

…still just a big ol’ blank area for the plot.


The course lecture doesn’t tell you, and the troubleshooting page doesn’t tell you, but the README file for the plotlyjs() does tell you:

You need to run jupyter labextension install jupyterlab-plotly from the command line.

After doing that (and restarting jupyter lab, and re-running the code), everything works. :partying_face:

1 Like