python - “nticks”在情节场景中不受 xaxis 的尊重
问题描述
让我们从代码开始:
b_min = [-3, 6, 0]
b_max = [24, 24, 9]
n_vertices = [10, 10, 10]
p_a = [-1, 11, 4.5]
p_b = [11, 9, 9]
p_c = [6, 8, 6]
p_d = [-1, 7, 10]
points = [p_a, p_b, p_c, p_d]
df = pd.DataFrame(points, columns=['x', 'y', 'z'])
figure = px.scatter_3d(df, x='x', y='y', z='z')
figure.update_layout(scene={
'xaxis': {'nticks': n_vertices[0], 'range': [b_min[0], b_max[0]]},
'yaxis': {'nticks': n_vertices[1], 'range': [b_min[1], b_max[1]]},
'zaxis': {'nticks': n_vertices[2], 'range': [b_min[2], b_max[2]]}
})
figure.show()
解决方案
在这里查看 scatter3d 轨迹的文档,nticks
是轴的最大刻度数,实际刻度数小于或等于nticks
.
推荐阅读
- sql - 如何根据特定条件选择行
- tensorflow - 为什么 tf.flags 与 argparse 冲突?
- ios - 如何在 FFmpeg 命令中指定图像
- python - 如果 Pandas 列不包含同一行中另一列的值,则将另一列中的值添加到新行中
- nginx - 当路由是 PHP 文件时,页面会显示错误。未指定输入文件
- r - 每次迭代后将列的元素相乘以跳过一个元素
- python - wxPython如何在状态栏中设置小部件位置
- python - Meta Open Graph xpath选择器的Python Selenium问题
- c# - 如何获取具有特定 nuget 包作为参考的项目
- c# - 水平合并csv文件