仅当创建1个时出现2个绘图图

发布于 2025-01-28 18:42:08 字数 632 浏览 1 评论 0原文

我正在尝试在行图中绘制数据框架并自定义标签,标题等。但是,它似乎创建了一个空图。

plot_df= plt.plot(df)

plt.figure(figsize=(30,8))
plt.title("TITLE.", fontsize=24)

plt.xticks(rotation=30, horizontalalignment="center", fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("X", fontsize=21, labelpad=12)
plt.ylabel("Y", fontsize=21, labelpad=8)
display(plot_df)

说图:

I'm trying to plot a data frame in a line graph and customise the labels, title, etc. However, it seems to create an empty diagram instead.

plot_df= plt.plot(df)

plt.figure(figsize=(30,8))
plt.title("TITLE.", fontsize=24)

plt.xticks(rotation=30, horizontalalignment="center", fontsize=16)
plt.yticks(fontsize=16)

plt.xlabel("X", fontsize=21, labelpad=12)
plt.ylabel("Y", fontsize=21, labelpad=8)
display(plot_df)

Said diagrams:
plot with intended content

plot with intended customisations

So the question here is, how do I customise the intended plot without conjuring up an empty one?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文