I'm attempting to plot the square roots in a single figure. However, this is not getting plotted. Can somebody help me?
import numpy as np
import matplotlib.pyplot as plt
plt.figure()
for i in np.arange(1,5):
    zm=i**2        
    plt.plot(i,zm,'r')    
    print(i,zm)
plt.show()
 
                        
A few issues with your code:
zmshould be an array, but instead it is an integer that gets overwritten every cycle with the return ofi**2,plot()instruction should be outside the loop,**operator.I guess this is what you are looking for:
BTW, I believe you meant
squareand notsquare root.I hope it helps.