Not plots with plotly, apple silicon and VSCode

romain-chiap
Tue, 12 Aug 2025 07:57:05 +0000
General Usage

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) Any solution?

3 posts - 2 participants