So, I've got three arrays of data, X, Y, and Z, each 225 numbers long. What I would like to do is to plot all three values at the same time on a surface plot.
所以,据我所知,你想要绘制一个三维曲面图。
但看起来你只提供了3个1xn阵列。(在这种情况下,n==255)
在绘制曲面图时,您实际要做的是获取每个可能的基准(XY平面)组合,并告诉给定XY坐标上的点Z有多高,因此Z被描述为函数Z(i,j)but I need the first Z point to be associated with the first X and Y point etc. Is this possible in Python?
是的,但是如果您将每个Z点与第一个X,Y等等相关联,则只有X==Y的Z值,这对于您的surfaceplot来说是不完整的信息!在
matplotlib officialdocs提供了一个很好的surface plot示例from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib import cm
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
fig = plt.figure()
ax = fig.gca(projection='3d')
# Make