Answers for "ADD A, B, C, D to Subplots in matplotlib"

0

ADD A, B, C, D to Subplots in matplotlib

import numpy as np
import matplotlib.pyplot as plt
import string

fig, axs = plt.subplots(2,2,figsize=(8,8))
axs = axs.flat

for n, ax in enumerate(axs):

    ax.imshow(np.random.randn(10,10), interpolation='none')    
    ax.text(-0.1, 1.1, string.ascii_uppercase[n], transform=ax.transAxes, 
            size=20, weight='bold')
Posted by: Guest on April-26-2022

Browse Popular Code Answers by Language