python - Asking User For Datetime Before Plotting Selected Points -


I am using Python 2.7.3, how can I tell the user to login with "date time" Can i Before the time when the criteria selected on the graph are framed, "From time to time" when user dated: 21/7/2014 0:00 to date time: 22/7/2014 23:57 Datetime import datetime import matplotlib.pyplot plt import matplotlib.dates as mdates x = [] y = [] t = [] fig = plt.figure () rect = fig.patch rect.set_facecolor ('# 31312e' ) ReadFile = open ('data.txt', 'r') sepFile = readFile .read (). Split ('\ n') readfile.close () idx, for plotpair enumerate (sepFile): If the 'Peer' in the plot: leave #. Or if IDX & gt; 1: T: # To release the first row candy = plotPair.split (',') TIME_STRING = candy [0] time_string1 = datetime.strptime (TIME_STRING, '% M% d /% M /% Y% H') . Attached (time_string1) y.append (boat (candy [1]) AX1 = fig.add_subplot (1, 1, 1, axisbg = 'white') ax1.xaxis.set_major_formatter (mdates.DateFormatter ('% d /% m /% Y% H:% M ')) ax1.plot (t, y,' c ', linewidth = 3.3) plt.title (' radiation ') plt.xlabel (' time ') fig.autofmt_xdate (rotation = 45 ) Fig.tight_layout () plt.show ()

Try it out.

] As y = [] t = [] fig = plt.figure () Rect = fig.patch rect.set_facecolor ('# 31312e') readfile = open ('C: \\ Temporary \\ 001.txt', 'R') sepFile = ReadFile.read (). Partition ('\ n') readFile.close () startTime = raw_input ('Please enter start time in format like') End time = raw_input ('Please enter end time as in format That is the start date = '21 / 7/2014 0:02 '#timetime = '22 / 7/2014 23:58' starttime = date .starttime (starttime, '% d / Endrime = DatymatistTruthTime (Endime, '% D /% M /% Y% H:% M') for IDMX, point PIE in Enquirer (SIPFIELD): Skip the consignment '.': # Or if IDX & gt; 1: # first row candy = plotPair.split (',') TIME_STRING = candy [0] time_string1 = leave datetime.strptime (TIME_STRING, '% d /% M /% Y% H:% M ') If STARTTIME & lt; = Time_string1 & lt; = endTime: t.append (time_string1) y.append (float (x and y [1]) ax1 = fig. Eda_spllot (1, 1, 1, axis- 'White') ax1.xaxis.set_major_formatter (Mdates.DateFormatter ('% d /% m /% Y% H:% M')) ax1.plot (t, y, 'c', linewidth = 3.3) plt.title ('IRRADIANCE') plt.xlabel ('time') fig. Autofamat_xdate (rotation = 45) fig.tight_layout () plt.show ()

Comments

Popular posts from this blog

c# - Textbox not clickable but editable -

Matlab transpose a table vector -

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -