plotly / plotly/plotly.py

scene aspectmodes "cube" or "manual" do not work with Scatter3D

未关闭
#2,511 6 条评论 6 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug P3
主要语言
Python
星标
18.8k
派生
2.8k
平均合并
16 小时 26 分钟
30 天内合并 PR
21

描述

Example from the plotly docs, with aspect mode set to cube.

import plotly.graph_objects as go
import numpy as np

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

layout = go.Layout(scene=dict(aspectmode="cube"))

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

On the x and y axis, one grid unit is length 0.5. On the z axis one grid unit is length 2.
Screen Shot 2020-05-27 at 1 09 15 PM

These should be displayed with equal lengths if the aspect ratio is a cube. Same issue with 'go.Layout(scene=dict(aspectmode="manual", aspectratio=dict(x=1, y=1, z=1)))'

This help post indicates this should work or worked in the past cc @empet
https://community.plotly.com/t/creating-a-3d-scatterplot-with-equal-scale-along-all-axes/15108

Thank you.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先运行提供的 Python 示例,其中使用 go.Layout(scene=dict(aspectmode="cube")),并比较渲染出的 x、y 和 z 网格单位长度。使用 aspectmode="manual" 和 aspectratio=dict(x=1, y=1, z=1) 重复相同的检查。当两种设置都为 Scatter3d 场景显示相等的轴长度时,即表示完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
data-visualization
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
35/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。