When is plt.show() required to show a plot and when is it not?

To require or not required depending on where your script is.

There are 2 contexts.

  1. Matplotlib is used in a terminal or scripts, plt.show() is a must.

  2. Matplotlib is used in a IPython shell or a notebook (ex: Kaggle), plt.show() is unnecessary.

Leave a Comment