Answers for "https://www.geeksforgeeks.org/matplotlib-axes-axes-cla-in-python/"

0

https://www.geeksforgeeks.org/matplotlib-axes-axes-cla-in-python/

# Implementation of matplotlib function
import numpy as np
import matplotlib.pyplot as plt
  
np.random.seed(19)
data = np.random.random((5, 10, 10))
  
fig, ax = plt.subplots()
  
for i in range(len(data)):
    ax.cla()
    ax.imshow(data[i])
    ax.set_title("Axes {}".format(i))
    plt.pause(0.1)
Posted by: Guest on April-26-2022

Python Answers by Framework

Browse Popular Code Answers by Language