Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- import sys
- import numpy as np
- import matplotlib.pyplot as plt
- from matplotlib.dates import DayLocator, HourLocator, DateFormatter, drange
- import datetime as dt
- ff = "temp-25c.txt"
- fn = open(ff, "r")
- tt = np.array([])
- d1 = np.array([])
- d2 = np.array([])
- d3 = np.array([])
- d4 = np.array([])
- for i in fn.readlines()[4:]:
- i = i.split()
- j = [int(ii) for ii in i[0].split('-')]
- k = [int(ii) for ii in i[1].split(':')]
- a = dt.datetime(j[2], j[0], j[1], k[0], k[1], k[2])
- tt = np.append(tt, a)
- d1 = np.append(d1, int(i[4]))
- d2 = np.append(d2, int(i[4]))
- d3 = np.append(d3, int(i[4]))
- d4 = np.append(d4, int(i[4]))
- ax = plt.subplot(111)
- ax.plot_date(tt, d1)
- ax.plot_date(tt, d2)
- ax.plot_date(tt, d3)
- ax.plot_date(tt, d4)
- plt.setp( ax.xaxis.get_majorticklabels(), rotation=70, horizontalalignment='right' )
- plt.tight_layout(
- plt.savefig("res.png")
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement