https://github.com/matplotlib/matplotlib
Matplotlib.pyplot is a module within Matplotlib.
The .pyplot module uses a collection of command functions.
Example of using matplotlib.pyplot
import matplotlib.pyplot as plt # Get the unique labels unique_labels = set(labels)# Initialize the figureplt.figure(figsize=(15, 15))# Set a counteri = 1labels = np.ndarray.tolist(labels)# For each unique label,for label in unique_labels: # You pick the first image for each label image = images[labels.index(label)] # Define 64 subplots plt.subplot(8, 8, i) # Don't include axes plt.axis('off') # Add a title to each subplot plt.title("Label {0} ({1})".format(label, labels.count(label))) # Add 1 to the counter i += 1 # And you plot this first image plt.imshow(image) # Show the plotplt.show()
plt.plot(range(10))plt.savefig('subplots.jpg')
*** In terminal macos, you are unable to view any images or plots. To see images or plots, you must export the file as a pdf by using " plt.savefig('example.jpg') ".***