0

I would like to know how to modify the scale of the axes and change the background color of the graph with plotly.

Thanks for the help.

enter image description here

1
  • Really what I want to do is change the values of the axes so that it is not in [km] but in [au] Commented Jul 8, 2021 at 0:34

1 Answer 1

1

You should check : https://plotly.com/python/

import plotly.graph_objects as go
import numpy as np


t = np.linspace(0, 10, 50)
x, y, z = np.cos(t), np.sin(t), t

fig = go.Figure(data=[go.Scatter3d(x=x, y=y, z=z, mode='markers')])


fig.update_layout(paper_bgcolor='pink', #Paper background 
              
                  scene=dict(aspectratio=dict(x=6, y=2, z=1), #3d axes ratio

                         xaxis=dict(backgroundcolor='red'),   
                         yaxis=dict(backgroundcolor='purple'), #axes background 
                         zaxis=dict(backgroundcolor='orange')
                         )
              )  

fig.show()

example figure

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.