Python script for plotting historical data