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

Discussão em 'Python' iniciado por Stack, Agosto 24, 2025.

  1. Stack

    Stack Membro Participativo

    Since the following code will show a plot without plt.show(), what is the point of plt.show()?

    Please tell me when plt.show() is required as this would allow me to appreciate the intricacy of matplotlib better.

    N.B.: I'm using this in Spyder (Anaconda)

    import matplotlib.pyplot as plt
    plt.subplot(211) # the first subplot in the first figure
    plt.plot([1, 2, 3])

    Continue reading...

Compartilhe esta Página