[Python] Matplotlib show function is showing the plot window minmized after python input...

Discussão em 'Python' iniciado por Stack, Fevereiro 20, 2025.

  1. Stack

    Stack Membro Participativo

    Im seeing strange behavior to the matplotlib plot.show() function as result of the python input command as in the below code. If I take the input command the plot window will show up and centered to the sceen, however if I add it back the plot window will be minimized. Im sure this is related to focus but not sure how to fix it.

    import matplotlib.pyplot as plt
    import numpy as np
    import tkinter

    #Remove the input line to see the difference
    input("presse any key to continue...")
    y = np.array([35, 25, 25, 15])
    plt.pie(y)
    plt.show()


    I tried the below suggestions but none worked or even compiled correctly specially around using the windowmanager.

    Matplotlib; open plots minimized? How to maximize a plt.show() window

    Im using python 3.11 and running my code with Visual Code on windows 11 machine.

    I'm just looking to display it with normal behavior not minimized nor maximized.

    Thanks

    Continue reading...

Compartilhe esta Página