我想用我的三维数据生成一张热图。在
我已经能够用这些数据绘制出trisurf。在
有人能帮我制作热图吗?我看到了在线教程,但是它们对3D来说都很复杂,我在这个网站上找到了一个在matplotlib中生成带有散点的热图,但是它只有2D数据。在
我生成trisurf的代码是from mpl_toolkits.mplot3d import Axes3D
from matplotlib import cm
import matplotlib.pyplot as plt
import numpy as np
n_angles = 36
n_radii = 8
# An array of radii
# Does not include radius r=0, this is to eliminate duplicate points
radii = np.linspace(0.125, 1.0, n_radii)
# An array of angles
angles = np.linspace(0, 2*np.pi, n_angles, endpoint=False)
# Repeat all angles for each radius
angles = np.repeat(angles[...,np.newaxis], n_radii, axis=1)
# Convert polar (radii, angles) coords to cartesian (x, y) coords
# (0, 0) is added here. There are no duplicate points in the (x, y) plane
x,y,z =np.loadt