I'm having some issues with matplotlib in Python 2.7. Basically, I'm trying to graph some values (Y) against a corresponding X value. What happens is I get a completely squished x-axis.
I have a variable, Xmse
that has the following value:
Xmse = [2028.5457074044693,
1653.3262637440594,
1337.3889339729938,
1176.2728864230257,
1072.2873906521645,
981.65920843213678,
912.14636955892638,
858.67713877925848,
807.43207831735913,
764.48689721143887]
Each value is calculated based on a boundary: boundary = [1,2,3,4,5,6,7,8,9,10]
.
So when I try to plot the graph where boundary
is my x-value and Xmse
is my Y value, I get this plot:
from this code:
plt.plot(boundary,Xmse)
plt.show()
So it seems like my y-values are almost inverted and for some reason I have a negative value on the y pat even though none of my values are negative. Also, the x-axis is squished. After looking online, I tried to add the following to my code:
plt.xticks([1,2,3,4,5,6,7,8,9,10])
plt.plot(boundary,Xmse)
plt.show()
But I still end up with the same plot. So how can I just graph a simple line which corresponds to an X-Y value in matplotlib?