Trong Jupyter Notebook, để hiển thị lại figure đã vẽ, dùng fig.show() sau khi tạo figure và axes.
Ví dụ minh họa
In [1]: %matplotlib auto Using matplotlib backend: Qt5Agg In [2]: import matplotlib.pyplot as plt In [3]: plt.rcParams["figure.figsize"] = [7.50, 3.50] ...: plt.rcParams["figure.autolayout"] = True In [4]: fig, ax = plt.subplots() In [5]: ax.plot([2, 4, 7, 5, 4, 1]) Out[5]: [] In [6]: fig.show()
Kết quả đầu ra
