I keep receiving:
TypeError: Invalid dimensions for image data
with a blank graph that has axis going from 0.0 to 1.0 on both sides
import numpy as np
import matplotlib.pyplot as plt
from numpy import sin,cos,sqrt,arctan2
from pylab import plot,show,xlabel,ylabel,linspace,ylim
D = 50
x = linspace(0,D,1000)
y = linspace(0,D,1000)
r1 = sqrt((x**2)+(y*2))
def function1():
f1 = sin(r1)
return f1
function1()
plt.imshow(r1,origin='lower',extent=[0,10,0,5])
plt.colorbar()
plt.show()