import matplotlib.pyplot as plt
import numpy as np

x = np.arange(5)
fig, axs = plt.subplots(2, 2)
for i in range(2):
   for j in range(2):
      axs[i, j].plot(x, x * (i + 1) + j, label=f"line_{i}_{j}")
      axs[i, j].set_xlabel("x")
      axs[i, j].set_ylabel("y")
      axs[i, j].set_title("Panel label")
fig.legend(loc="upper right", ncol=1, frameon=False)