【问题标题】:How to label each graph with different x-axis name and y-axis name [duplicate]如何用不同的x轴名称和y轴名称标记每个图[重复]
【发布时间】:2021-07-29 01:56:29
【问题描述】:
fig_1 = plt.figure(1, figsize=(6.4, 4.8))

chart_1 = fig_1.add_subplot(121)
chart_2 = fig_1.add_subplot(122)

chart_1.plot(year, apl_price)
chart_2.plot(year, ms_price)

plt.show()

【问题讨论】:

  • chart_1.set_xlabel(...), chart_1.set_ylabel(...)... 也可能更容易做到fig_1, (chart_1, chart_2) = plt.subplots(ncols=2, figsize=(6.4, 4.8))

标签: python matplotlib


【解决方案1】:

我想你正在使用 matplolib,你可以使用 matplotlib.pyplot.xlabelmatplotlib.pyplot.ylabelmatplotlib.pyplot.xlabel matplotlib.pyplot.ylabel

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    • 2015-03-10
    • 2018-11-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多