Nov-20-2021, 03:39 AM
(This post was last modified: Nov-20-2021, 03:39 AM by deanhystad.)
x = np.arange(-4, 4, 0.2) returns a list of 40 numbers starting at -4 and ending at 3.8, incrementing by 0.2. If it didn't you wouldn't get the values you are for y. Your problem is you are not plotting x vs y. You are plotting y and matplotlib is providing values for x.
Next time you have a problem like this LOOK AT THE VALUES. Print x and y and you would realize they were both correct and the problem must be you weren't doing the plot correctly. Then you would probably notice "Oh, I didn't include x in the plot command. I probably need to do that."
Next time you have a problem like this LOOK AT THE VALUES. Print x and y and you would realize they were both correct and the problem must be you weren't doing the plot correctly. Then you would probably notice "Oh, I didn't include x in the plot command. I probably need to do that."