import matplotlib.pyplot as plt
import numpy as np
x = np.arange(0., np.e, 0.01)
y1 = np.exp(-x)
y2...111)
ax1.plot(x, y1)
ax1.set_ylabel('Y values for exp(-x)')
ax1.set_title("Double Y axis")
ax2 = ax1.twinx...# 生成画布, 并设定标题
plt.figure(figsize=(8, 6), dpi=80)
plt.grid(True)
# 画图的另外一种方式
ax_1 = plt.subplot(111)
ax...set_ylabel("cosy")
ax_1.set_ylim(-1.0, 1.0)
ax_1.set_yticks(np.linspace(-1, 1, 9, endpoint=True))
# 画图的另外一种方式...ax_2 = ax_1.twinx()
ax_2.plot(x, y_sin, color="green", linewidth=2.0, linestyle="-", label="sin")
ax