Can't get a transparent backgound in PlotlyJs

Hi @1153dent, you have a point. I forgot about that annoying problem related to (outdated) packages that PlotlyJS needs to spit out the plots in VSCode or Atom. If I run my code in VSCode, I get what you got, plus a massive amount of garbage associated with WebSockets, WebIO, Mux, and Blink.

But if you use Pluto.jl and the package PlutoPlotly.jl (according to @disberd, there is no need to use PlotlyJS directly), you can get what you need. With the precious help of @empet, find below the code that will certainly work in Pluto. I advise you to avoid installing Pluto and PlotlyJS in the same environment because PlotlyJS will deprecate Pluto. If you install Pluto, you do not need to install PlotlyJS. Pluto will install the packages required for the job to be done.

begin
	using PlutoPlotly

	fig22 = Plot(randn(150), Layout(yaxis_visible = false , xaxis_visible = false))
	relayout!(fig22, hovermode="x", template = "plotly_white")
	p4 = PlutoPlot(fig22)
end

and your four panels:

begin
	make_plot() = Plot(scatter(x=1:10, y=rand(10)),
                   Layout(yaxis_visible = false , xaxis_visible = false )
                   )
	fig10 = [make_plot() make_plot() ; make_plot() make_plot()]
	relayout!(fig10, template = "plotly_white")
	p5 = PlutoPlot(fig10)
end

2 Likes