Pyplot not respond

When I run These Code (I got from The Bored Robot In youtube) for import output from arduino IDE to plot. It's not respond, It's just show only white fleeze window.

import serial
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import csv
plt.show(block=True)
SERIAL_PORT = 'COM3'
BAUD_RATE = 9600

def handle_missing_data(data):
  try:
    return float(data)
  except ValueError:
    return 0.0 

ser = serial.Serial(SERIAL_PORT, BAUD_RATE)

x_vals = []
celsius_data = []
fahrenheit_data = []

def read_and_process_data():
  line = ser.readline().decode('utf-8').strip()
  sensorValues = line.split(', ')  

  time_value = handle_missing_data(sensorValues[0])
  celsius_value = handle_missing_data(sensorValues[1])
  fahrenheit_value = handle_missing_data(sensorValues[2])

  x_vals.append(time_value)
  celsius_data.append(celsius_value)
  fahrenheit_data.append(fahrenheit_value)

  print(f'Time: {time_value}, Celsius: {celsius_value}, Fahrenheit: {fahrenheit_value}')

def update_plot(frame):
  read_and_process_data()
  plt.cla()
  plt.plot(x_vals, celsius_data, label='Celsius')
  plt.plot(x_vals, fahrenheit_data, label='Fahrenheit')
  plt.xlabel('Time')
  plt.ylabel('Temperature')
  plt.legend()

def on_close(event):
  with open('sensor_data.csv', 'w', newline='') as csvfile:
    writer = csv.writer(csvfile)
    writer.writerow(['Time', 'Celsius', 'Fahrenheit'])
    for x, c, f in zip(x_vals, celsius_data, fahrenheit_data):
      writer.writerow([x, c, f])

fig, ax = plt.subplots()
fig.canvas.mpl_connect('close_event', on_close)

ani = FuncAnimation(fig, update_plot, interval=10) 
plt.show()

And this is code in Arduino IDE

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
  Serial.begin(9600);

  Serial.println("Adafruit MLX90614 test");  

  mlx.begin();  
}

void loop() {
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempC()); 
  Serial.print("*C\tObject = "); 
  Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempF()); 
  Serial.print("*F\tObject = "); 
  Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();
  delay(500);
}

If the Arduino is on COM3, then when you connect with Python, it will reset the Arduino. It may take a couple seconds to come online.

Best bet is connect, then wait for the Arduino to send "Adafruit MLX90614 test". I would move that send to the last thing in setup:

void setup() {
  Serial.begin(9600);
  mlx.begin();  
  Serial.println("Adafruit MLX90614 test");  
}

After wait for the Arduino to send "Adafruit MLX90614 test", I should fix some code in VScode?

Your challenge is you are attempting to communicate with a device that is resetting. You must wait for it to finish resetting. After that, it may work. Before that, it will fail.

I should upload arduino IDE first? and Next, it's run VScode?

When your Python code does this:
ser = serial.Serial(SERIAL_PORT, BAUD_RATE)
the Arduino resets. It doesn't talk or listen while resetting.
Wait for the Arduino to send "Adafruit MLX90614 test". After that, it will send your formatted data to your Python script.

After I run Arduino, It's not send "Adafruit MLX90614 test". It's just send output of Sensor immediately in serial monitor. In output, It's sent Leaving... Hard resetting via RTS pin... .And I waited it for 4-5 minutes already.

If it doesn't, the code you are running is not the code you posted.
The first thing it sends is from setup.

 Serial.println("Adafruit MLX90614 test");  

Edit: Maybe I'm off base. Which Arduino are you running this on?

This is my code in arduino ide

#include <Wire.h>
#include <Adafruit_MLX90614.h>

Adafruit_MLX90614 mlx = Adafruit_MLX90614();

void setup() {
  Serial.begin(9600);
  mlx.begin();  
  Serial.println("Adafruit MLX90614 test");  
}

void loop() {
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempC()); 
  Serial.print("*C\tObject = "); 
  Serial.print(mlx.readObjectTempC()); Serial.println("*C");
  Serial.print("Ambient = "); 
  Serial.print(mlx.readAmbientTempF()); 
  Serial.print("*F\tObject = "); 
  Serial.print(mlx.readObjectTempF()); Serial.println("*F");

  Serial.println();
  delay(500);
}

I use Node MCU ESP8266