-
-
Notifications
You must be signed in to change notification settings - Fork 8k
Description
Hi ,
I just begin to use this library so I have a lot to learn and I apologize if this turns to be false alarm or an old issue. I did research but nothing turned up.
The issue:
Im using matplotlib to create visuals using Python . The code is just simple python code that prompt user input through standard terminal in windows (console) which Im not sure if this is the right plaform for such library but in a simple example without prompting user input when I run the command plot.show() it works by opening matplotlib window showing the visual. However if I add line of code to ask for user input before calling the show() function as in :
input("Please press any key...")
the visual window will show minimized!
Example
The following code shows the behavior by removing\adding the input command
import matplotlib.pyplot as plt
#Remove or add the input statement to see the difference on how the window is showing up or showing minimized
input("Press any key to contiue...")
# Data for the pie chart
labels = ['Category A', 'Category B', 'Category C', 'Category D']
sizes = [25, 30, 20, 25]
colors = ['gold', 'yellowgreen', 'lightcoral', 'lightskyblue']
explode = (0, 0.1, 0, 0) # explode the 2nd slice (i.e. 'Category B')
# Plot
plt.pie(sizes, explode=explode, labels=labels, colors=colors, autopct='%1.1f%%', shadow=True, startangle=140)
plt.axis('equal') # Equal aspect ratio ensures that pie is drawn as a circle.
plt.title('Sample Pie Chart')
plt.show()
The ask:
How this can be mitigated?
Thanks