Hi,
I am trying to produce a figure with two subplots in Pluto, using PlotlyJS and PlutoPlotly. If I create each plot individually, there is no problem: all the layout attributes of the individual plots will come out correctly. However, when I produce a figure with the two subplots, some attributes come out OK (like titles, hover, names), but not shapes
. Strangely, shapes are supposed to appear in both subplots, but they are only visible in the first subplot. Unfortunately, I do need the shapes to appear in all subplots.
As usual, @empet solved my problem here:
using PlotlyJS
fig= make_subplots(rows=1, cols=2, subplot_titles=["Some noise" "More noise"])
add_trace!(fig, scatter(;x=1:50, y=rand(50), name = "some"), row=1, col=1)
add_trace!(fig, scatter(;x=1:50, y=rand(50), name = "more"), row=1, col=2)
relayout!(fig, hovermode="x")
add_vrect!(fig, 5, 10, fillcolor = "red", opacity = 0.2, line_width = 0; row=1, col=1)
add_vrect!(fig, 20, 26, fillcolor = "blue", opacity = 0.2, line_width = 0; row=1, col=2)
display(fig)
If I run @empetβs code in Atom/VScode, having the internal plot pane activated, the figure with subplots comes out OK, and no error is thrown out.
However, suppose the external plot window is activated. In that case, the figure is still produced, but an infinite set of garbage pops out β as soon as we click on the figure β alleging problems with WebSockets, Mux, Blink, and WebIO.
The same code also works very well in VSCode/Atom using PlotlyJS, ElectronDisplay
as proposed by @stephancb here
Nevertheless, I need these figures in Pluto, not Atom or VScode. I tried to replicate the same code in Pluto (v0.19.12), using PlotlyJS (v018.8) and PlutoPlotly (v.03.4). Still faced two problems: (i) without using WebIO
, no plot is produced, and the infamous error WebIO not detected
pops up.; (ii) with using WebIO
, no error is thrown out, but the figure is nowhere to be seen. In the latter case, if I close the block by using display(fig)
, this is what I get:
and if I opt for closing the block by calling fig
, nothing comes out.
I get the same behavior by using PlutoPlotly.jl or @disberdβs initial workaround to integrate PlotlyJS inside Pluto here.
Help will be very much appreciated. Thanks