3d scatter plot transparent

Hey Im trying to do a 3d Scatter plot for a network visualization. I want the background (of the plot and paper) to be transparent. Everywhere i searched for this was recommended as style settings for layout: paper_bgcolor=โ€˜rgba(0,0,0,0)โ€™,
plot_bgcolor=โ€˜rgba(0,0,0,0)โ€™

But it is always white. As an small example:

Any ideas what im doing wrong?

@Varlor

For 3d networks you must set invisible axes, not transparent plot_bgolor:

fig.update_scenes(xaxis_visible=False, yaxis_visible=False,zaxis_visible=False )

2 Likes

Thank you very much, worked for me!

@hilde1
A few different backgrounds for 3d plots: https://chart-studio.plotly.com/~empet/16190

Can the grid lines be avoided while still having the axis titles in place?

@matan3
Is this plot what you intend to get?

ax_style = dict(showbackground =True,
                backgroundcolor="rgb(240, 240, 240)",
                showgrid=False,
                zeroline=False)


fig = go.Figure(go.Scatter3d(x=[0, 1], y=[-1, 0.2], z=[1, 2], mode="lines", line_color="red", line_width=2))
fig.update_layout(template="none", width=600, height=600, font_size=11,
                  scene=dict(xaxis=ax_style, 
                             yaxis=ax_style, 
                             zaxis=ax_style,
                             camera_eye=dict(x=1.85, y=1.85, z=1)))

You may change the backgroundcolor