1 Star 0 Fork 1

刘文彪/Python数据分析学习

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
plot3d.py 693 Bytes
一键复制 编辑 原始数据 按行查看 历史
tongzi 提交于 2018-12-19 09:18 . plot 3d
#!/usr/bin/env python3
#-*- coding: utf-8 -*-
#Name module
#Purpose
#
#Author tongzi
#
#Created 2018/1/28
#Copyright: (c)tongzi 2018
#License: tongzi
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
point = np.array([1, 2, 3])
normal = np.array([1, 1, 2])
# a plane is a*x+b*y+c*z+d=0
# [a,b,c] is the normal. Thus, we have to calculate
# d and we're set
d = -point.dot(normal)
# create x,y
xx, yy = np.meshgrid(range(10), range(10))
# calculate corresponding z
z = (-normal[0] * xx - normal[1] * yy - d) * 1. /normal[2]
# plot the surface
plt3d = plt.figure().gca(projection='3d')
plt3d.plot_surface(xx, yy, z)
plt.show()
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/liu-wenbiao-sxhh/DataAnalysisLearning.git
git@gitee.com:liu-wenbiao-sxhh/DataAnalysisLearning.git
liu-wenbiao-sxhh
DataAnalysisLearning
Python数据分析学习
master

搜索帮助