Hello everyone,
I have a bit of a problem with my labels the layout of my 3D plots, as mentioned in the title of this topic the labels and the ticks of my axis are overlapping and it is not very readable as showed in the picture bellow:
I saw that for 2D plots there is a setting called "standoff " but it doesn’t seem to work for 3D plots…
For reproducibility here is the code used for the plot:
import plotly.graph_objects as go
x_test = [2.49, 9.42, 4.02, 1.26, 3.63, 3.24, 3.32, 5.38, 0.01, 2.34, 1.32, 2.39, 0.03, 0.13, 0.5, 6.98, 5.69, 7.52, 0.29, 5.26]
y_test = [-0.487141057535954, -0.1739370211548781, -0.2853610683825882, -0.2603715984938043, -0.2834545295954328, -0.3145613300174327, -0.25231472198401017, -0.32401874359834243, -0.2463074044483581, -0.30691152824071904, -0.2096916224465384, -0.2387730864169937, -0.3376285264647891, -0.24712990875211546, -0.2595989351750248, -0.3215546564673653, -0.21553088786098384, -0.4796141378723439, -0.3198967657764705, -0.2524960229258826]
z_test = [1.1870833990620628, 0.8257746785220291, 1.1177473955973154, 0.3609832417771556, 1.153135493184252, 1.2030424268943862, 1.1528140313080235, 1.0333331481552532, 0.06252902220622154, 1.0847424079253398, 0.3789157142845863, 1.0545395009424001, 0.06737219002209101, 0.07048240692720592, 0.10958139516671886, 0.9791961752699484, 0.9366383384184078, 1.005348173317347, 0.08842784180899503, 0.9970969955188956]
fig = go.Figure()
# Add scatter plot
fig.add_scatter3d(x = x_test,
y = y_test,
z = z_test,
mode='markers',
marker = dict(size = 5,
opacity = 0.6,
color = 'green',
symbol = 'circle')
)
# ------------------------------------------------------------------------------
fig.update_layout(scene = dict(
xaxis_title = 'Some random <br>x label',
yaxis_title = 'Some random <br>y label but<br> a bit longer',
zaxis_title = 'Some random <br>z label but<br> a bit longer'))
fig.update_layout(showlegend=False)
fig.update_layout(font=dict(size = 14))
# ------------------------------------------------------------------------------
fig.update_layout(hovermode="x unified", template='plotly_white')
# Add to give plot a title
fig.update_layout(title_text="Some title",
font=dict(size=16)
)
fig.show()
If anyone has a solution to my problem I would greatly appreciate it!