Home>
It is almost as the title.
I want to make an animation with matplotlib,
At first, I tried to write a program that "display coordinates [1,5] for 3 seconds, then display coordinates [2,6]", but
A window with coordinates [1,5] appears. If i delete the window, a window with coordinates [1,5] appears after 3 seconds.
It will bebehavior. (Well, it's natural that it works because I'm writing a program)
Please tell me how to display only the graph for 3 seconds without changing the window.
※ I do not want to use matplotlib.animation, so please use other than this><
The following is the current program.
import numpy as np
import matplotlib.pyplot as plt
import time
fig = plt.figure () # set figure
ax = fig.add_subplot (111) # Add graph drawing area
ax.set_xlim (0, 100) # Set axis range
ax.set_ylim (0, 100)
plt.plot (1, 5, marker = '.', markersize = 20, color = 'lightsalmon')
plt.show ()
time.sleep (3)
plt.plot (2, 6, marker = '.', markersize = 20, color = 'lightsalmon')
plt.show ()
-
Answer # 1
Related articles
- i am trying to display a graph with matplotlib in python, but no error is displayed and the graph is not displayed
- python - i want to display a graph of matplotlib on tkinter and enable mouse operation in canvas
- matplotlib - i'm trying to display a diagram, but i get an error and can't display it
- css - [react] display: block is specified but it does not line up vertically
- vba - i want to display a specified form in the access subform
- the y-axis spacing of matplotlib is not constant and the graph is not displayed correctly
- [python] about graph display
- ios - i want to display the contents of textfield specified in another file in label of transition destination
- python - [django] i want to display the date after the specified number of days
- matplotlib - i want to display the seaborn x-axis date every 7 days
- i want to display only the part of sqlserver specified string
- python: i want to change the way the graph is displayed in matplotlib
- if the specified class exists, you want to display a certain element (jquery)
- python - i want to display columns in csv as a legend in the graph
- c # - wpf i want to display the datagrid with the specified column of the acquired csv
- python - create a line graph using matplotlib
- wordpress - i want to display a custom post type in the specified number
- matplotlib display circles at regular intervals
- canvas - i want to select data with tkinter and display it as a graph or change the color with matplotlib
- matplotlib - to draw a bar graph with figadd_subplot ()
Related questions
- [python] unable to use packages installed with wsl
- python - i want to display a graph of matplotlib on tkinter and enable mouse operation in canvas
- about python animation axis setting
- matplotlib - how to plot the same day of the week in another year
- matplotlib - i want to draw a stacked bar graph
- matplotlib - i want to draw a 3d scatter plot
- matplotlib - embedding in python tkinter doesn't work and update fails
- matplotlib - where to save the animation video
- python - i want to find the average hsv value for each divided image
- matplotlib - the image of matplot is displayed on the gui of tkinter, but i want to display the histogram in a separate window
pause
is a function that has been written in the document as "It is recommended to use animation if you do it properly" or "It is experimental and cannot guarantee fine operation", so this method is ideal It is not a translation. Think of it as an answer that you could have just tried in my environment (depending on the environment, the above code may not work).matplotlib.pyplot.pause — Matplotlib 3.1.1 documentation