Varlor
March 16, 2020, 6:00pm
1
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?
empet
March 16, 2020, 7:25pm
2
@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
Varlor
March 16, 2020, 11:40pm
3
Thank you very much, worked for me!
empet
September 28, 2022, 11:14am
5
matan3
August 26, 2023, 6:36pm
6
Can the grid lines be avoided while still having the axis titles in place?
empet
August 26, 2023, 7:52pm
7
@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