python - Formatting X axis with dates format Matplotlib -
I have written a code that gives a plot to the user for the stock market for the last seven days over the last seven days is. The problem I have is that I want to format X axis in a YYMMDD format. I do not even understand what the meaning of 2.014041 A7 at the end of the X axis is.
Values for X are: 20140421.0, 20140417.0, 2014041.0, 20140415.0, 2014.04.0.0, 20140411.0, 20140410.0 < / P> There are values for y: 531.17, 524.94, 519.01, 517.96, 521.68, 519.61, 523.48 My The code is: When you use your method If you plot your data using, then you are just plotting your You need to change your data from these flows to understand TS matplotlib In the appropriate format, the code below takes your two lists (X, Y) and converts them. Not. This code is commented on, so that it is easily self explanatory. Details on various modules can be found below:
mini = min (y) maxi = maximum (y) min = mini-75 max = maxi + 75 min2 = int (min (x)) maxi2 = int (max. (X)) plt.close ('all') fig, ax = plt.subplots (1) pylab.ylim ([minimum, max]) pylab.xlim ([mini2, maxi2]] ax.plot (x, y) ax.plot (x, y, 'ro') ax.plot (x, m * x + c) ax.grid () ax.plot ()
y data such as
against
x numbers in
x 20140421.0 (which I think you want to mean by date 21/04/2014).
Comments
Post a Comment