Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Remove plotly tick labels

I wanted to make a plotly 3d graph with no tick labels but I failed to find a way to do so

I tried fig.update_layout(xaxis=dict(showticklabels=False)) but the tick labels still appears.

import numpy as np

x = np.linspace(-1,1,100)
y = np.linspace(-1,1,100)
x_mesh, y_mesh = np.meshgrid(x,y)
z = x_mesh**2 + y_mesh**2

fig = go.Figure(data=[go.Surface(x=x,y=y,z=z,colorscale='Sunsetdark_r')])
fig.update_layout(xaxis=dict(showticklabels=False))

fig.show()

Output image

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

I needed to remove the marked numbers.

>Solution :

Slightly different syntax for 3d charts, try this:

fig.update_layout(
    scene=dict(
        xaxis=dict(showticklabels=False),
        yaxis=dict(showticklabels=False),
        zaxis=dict(showticklabels=False),
    )
)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading