相关疑难解决方法(0)

Matplotlib在3D表面绘制非均匀数据

我有一个简单的代码来绘制Matplotlib的3D点 - 如下所示 -

from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
from numpy import genfromtxt
import csv

fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')

my_data = genfromtxt('points1.csv', delimiter=',')
points1X = my_data[:,0]
points1Y = my_data[:,1]
points1Z = my_data[:,2]

## I remove the header of the CSV File.
points1X = np.delete(points1X, 0)
points1Y = np.delete(points1Y, 0)
points1Z = np.delete(points1Z, 0)

# Convert the array to 1D array
points1X = np.reshape(points1X,points1X.size)
points1Y = np.reshape(points1Y,points1Y.size)
points1Z = np.reshape(points1Z,points1Z.size)

my_data …
Run Code Online (Sandbox Code Playgroud)

3d plot matplotlib

8
推荐指数
1
解决办法
1万
查看次数

标签 统计

3d ×1

matplotlib ×1

plot ×1