Not plots with plotly, apple silicon and VSCode

Hello dears,
I just changed my macos intel for a macos M4 and I’m trying to run my jupyter notebook plotting scripts. Here is a snippet of my code

using Plots
BG_COLOR = RGB(0.2, 0.2, 0.2); 	# background color of the plots
plotly();
# gr();

vs = logs["vehicle_status"]       # data structure containing the actual data to be plotted
plot(vs.t, [vs.arming_state vs.failsafe],label=["arming_state" "failsafe"],background_color=BG_COLOR,ylabel="(deg)",xlabel="time (s)",title="vehicle status")
state_map = DefaultDict(() -> "Unknown State", Dict(0 => "Manual", 1 => "Altitude", 2 => "Position", 3 => "Mission", 4=> "Hold", 5 => "RTL", 10 => "Acro", 12 => "descent", 13 => "termination", 18 => "auto land"))
hover_text = [state_map[i] for i in vs.nav_state]
plot!(vs.t, vs.nav_state, label="nav_state", hovertext=hover_text,legend=:topleft)

The result displays is an empty space for the plot, without the actual plot, no axis, nothing. When using gr() instead of plotly() it works fine but then I lose the interactive functionality of plotly: value of the datapoint when hovering the mouse, interactive zoom, etc.

I’m not attached to plotly, I’m just attached to not recoding my plotting script (500 lines of code) :upside_down_face: Any solution?

Does downgrading Plots.jl to v1.40.13 solve the problem? If so, then you’re running into [BUG] `PlotlyJS` backend renders blank plots in `Pluto` · Issue #5156 · JuliaPlots/Plots.jl · GitHub

yes, downgrading downgrading Plots.jl to v1.40.13 solved the problem !

For now, I’m very satisfied with this workaround :slight_smile:

2 Likes