Untitled
unknown
python
8 months ago
421 B
1
Indexable
Never
import matplotlib.pyplot as plt import numpy as np fig, axs = plt.subplots(1, 3) fig.suptitle('Subplots') x = np.array([1, 2, 3, 4, 5, 6]) y = np.array([2, 6, 3, 9, 1, 6]) x2 = np.array([1, 2, 3, 4, 5, 6]) y2 = np.array([5, 0, 0, 55, -100, 6]) axs[0].plot(x, y) axs[0].set_ylabel('YLabel', loc='top') axs[0].set_xlabel('XLabel', loc='left') axs[1].plot(x2, y2) axs[2].plot(x2, -y2) plt.show()
Leave a Comment