使用2D numpy数组绘制带有matplotlib

时间:2016-05-31 22:18:53

标签: python numpy matplotlib plot

假设我有以下脚本:

from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
import numpy as np

N = 100
L1 = 40; L2 = 60; L3 = 20

A1 = np.zeros([N,N])
A2 = np.copy(A1)
A3 = np.copy(A1)

midpoint = int(N/2)
A1[midpoint-int(L1/2):midpoint+int(L1/2), midpoint-int(L1/2):midpoint+int(L1/2)] = 1
A2[midpoint-int(L2/2):midpoint+int(L2/2), midpoint-int(L2/2):midpoint+int(L2/2)] = 1
A3[midpoint-int(L3/2):midpoint+int(L3/2), midpoint-int(L3/2):midpoint+int(L3/2)] = 1

如何绘制具有A1,A2和A3的多面体作为该多面体的顶部,中间和底部切片?

0 个答案:

没有答案