用Python画一个3D散点图
程序员文章站
2024-01-19 12:36:58
...
话不多说,直接代码~
from pyecharts import Scatter3D
import random
data = [
[random.randint(0, 100),
random.randint(0, 100),
random.randint(0, 100)] for _ in range(580)
]
range_color = [
'#313695', '#4575b4', '#74add1', '#abd9e9', '#e0f3f8', '#ffffbf',
'#fee090', '#fdae61', '#f46d43', '#d73027', '#a50026']
scatter3D = Scatter3D("3D散点图", width=1200, height=600)
scatter3D.add("", data, is_visualmap=True, visual_range_color=range_color)
# 在浏览器中打开
scatter3D.render()
上一篇: WPF 动态图的插入方法