Best option for time series with Python matplotlib

There are 3 coding samples below which demo auto scaling for dates in Python’s MatPlotLib. Best one appears to be the last one.

Sourced links are listed as well

Join my FREE newsletter to learn how I use these coding samples for automated trading in Python

#http://stackoverflow.com/questions/29461608/matplotlib-fixing-x-axis-scale-and-autoscale-y-axis # import numpy as np # import matplotlib.pyplot as plt # # x, y = np.arange(0,101,1) ,300 - 0.1*np.arange(0,101,1) # mask = (x >= 50) & (x <= 100) # # fig, ax = plt.subplots() # ax.scatter(x[mask], y[mask]) # # plt.show() #http://stackoverflow.com/questions/32972371/how-to-show-date-and-time-on-x-axis-in-matplotlib # import matplotlib.pyplot as plt # import pandas as pd # import matplotlib.dates as mdates # # times = pd.date_range('2015-10-06', periods=500, freq='10min') # # fig, ax = plt.subplots(1) # fig.autofmt_xdate() # plt.plot(times, range(times.size)) # # xfmt = mdates.DateFormatter('%d-%m-%y %H:%M') # ax.xaxis.set_major_formatter(xfmt) # # plt.show() #this one works best and easiest it seems #http://blog.mafr.de/2012/03/11/time-series-data-with-matplotlib/ import numpy as np import matplotlib.pyplot as plt import matplotlib.dates as mdates days, impressions = np.loadtxt("page-impressions.csv", unpack=True, converters={ 0: mdates.strpdate2num('%Y-%m-%d')}) plt.plot_date(x=days, y=impressions, fmt="r-") plt.title("Pageessions on example.com") plt.ylabel("Page impressions") plt.grid(True) plt.show()

**NOTE**I now post my

**into my personal FACEBOOK ACCOUNT and TWITTER. Don't worry as I don't post stupid cat videos or what I eat!**

*TRADING ALERTS*