McDermott-Group / servers

Public repo that stores LabRAD servers and other non-measurement related code
0 stars 2 forks source link

[DataChest, Grapher] Implement time view in grapher #38

Open roboguy222 opened 8 years ago

roboguy222 commented 8 years ago

Here is some sample code for how to do pretty date axes:

# set up figure (with multiple lines)
self.fig = pylab.figure()
self.ax = self.fig.add_subplot(111)
self.ax.set_title('Realtime Temperature Readout\n\n\n')
self.ax.set_xlabel('Time')
self.ax.set_ylabel('Temparture [K]')
self.stage60K, = self.ax.plot_date([],[],'-')
self.stage03K, = self.ax.plot_date([],[],'-')
# [add data to plots as floats]
# format before updating redrawing plot
hfmt = mpl.dates.DateFormatter('%H:%M:%S')
self.ax.xaxis.set_major_formatter(hfmt)
self.fig.autofmt_xdate()
self.fig.tight_layout()