Python Forum
Wrong dimension for my plot - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Wrong dimension for my plot (/thread-17827.html)



Wrong dimension for my plot - Jemeronimo - Apr-25-2019

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?


RE: Wrong dimension for my plot - Larz60+ - Apr-25-2019

Quote:What should I change about my code?
It would be rather helpful if you show the code you would like to change.