Python Forum

Full Version: Wrong dimension for my plot
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hey guys,

I'm trying to plot something use np.linspace.
I wrote a function called
def snr():
and the output for example is
print(snr(0.25))=400
print(snr(0.50))=200
print(snr(0.75))=400

and now I want to plot this function

x = np.linspace(0.25 , 0.75, 1000)

ax1.plot(x, snr(x))

It tells me that my snr(x) has dimension 1. What should I change about my code?
Quote:What should I change about my code?
It would be rather helpful if you show the code you would like to change.