首页 > 解决方案 > DataFrame 的 3D 绘图

问题描述

![在此处输入图像描述

**我正在尝试在 3D 中绘制一个 DataFrame。我做错了什么?**

x = drop_1row_df.columns.tolist()
print(x)

y = drop_1row_df.index.strftime("%d %b, %Y").tolist()
print(y)

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

X,Y = np.meshgrid(x,y)
Z = drop_1row_df
fig = plt.figure()
ax = fig.add_subplot(111, projection='3d')
ax.plot_surface(X, Y, Z)

标签: python-3.x

解决方案


推荐阅读