python 中的轴命名

AKR*_*AKR 5 matplotlib python-3.x

我理解使用matplotlib.

plt.xlabel('x-axis')

plt.ylabel('y-axis')
Run Code Online (Sandbox Code Playgroud)

可以在 python 中用于命名轴和标题等,只是在寻找 ward 来命名其他轴。

显示所需轴的图像

Ane*_*ran 3

import matplotlib.pyplot as plt  
x = [1,2,3]
y = [3,4,6]

p = plt.plot(x,y)
plt.twinx().set_ylabel('right Y lable')
Run Code Online (Sandbox Code Playgroud)

输出