2
votes

From what I understand, this is different from plotting in 2D and may not be possible from the plotly API.

I'm plotting spatial data, and my data looks skewed because 1 meter in the X-axis is not equal to 1 meter in the Y axis, etc.

Example:

  • x values in the range [0, 30]
  • y values in the range [0, 120]
  • z values in the range [0, 1]

By default, differences in z will look exaggerated when spatially they are very small; plotly uses a cube to visualize the entire range no matter what the scale of the data is. If I set the range of each axis to be [0, 120], the data I'm visualizing will be square / at the same ratio but very small at the bottom of the plot, making it hard to see and interact with.

1

1 Answers

5
votes

You need to use the aspectmode option in the Layout object.

layout = Layout(
             scene=dict(
                 aspectmode='data'
         ))
figure = Figure(data=data, layout=layout)
plot(figure)