Created
February 3, 2016 18:36
-
-
Save Atticuss/4e3a4fe84c9a087965e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import plotly.offline as py | |
import plotly.graph_objs as go | |
import numpy as np | |
with open('temps_orig.txt', 'r') as f: | |
tempOrig = json.loads(f.read()) | |
with open('fanspeeds_orig.txt','r') as f: | |
fanspeedOrig = json.loads(f.read()) | |
with open('temps_external.txt', 'r') as f: | |
tempExternal = json.loads(f.read()) | |
with open('fanspeeds_external.txt','r') as f: | |
fanspeedExternal = json.loads(f.read()) | |
with open('temps_internal.txt', 'r') as f: | |
tempInternal = json.loads(f.read()) | |
with open('fanspeeds_internal.txt','r') as f: | |
fanspeedInternal = json.loads(f.read()) | |
with open('temps_both.txt', 'r') as f: | |
tempBoth = json.loads(f.read()) | |
with open('fanspeeds_both.txt','r') as f: | |
fanspeedBoth = json.loads(f.read()) | |
def plotData(array,x,filename): | |
trace0 = go.Scatter( | |
x = x, | |
y = [array[str(i)]['1'] for i in x], | |
name = 'GPU 1' | |
) | |
trace1 = go.Scatter( | |
x = x, | |
y = [array[str(i)]['2'] for i in x], | |
name = 'GPU 2' | |
) | |
trace2 = go.Scatter( | |
x = x, | |
y = [array[str(i)]['3'] for i in x], | |
name = 'GPU 3' | |
) | |
trace3 = go.Scatter( | |
x = x, | |
y = [array[str(i)]['4'] for i in x], | |
name = 'GPU 4' | |
) | |
data = [trace0,trace1,trace2,trace3] | |
py.plot(data, filename=filename) | |
x = [i for i in range(0,60*30)] | |
plotData(tempOrig, x,'temp_orig.html') | |
plotData(fanspeedOrig, x, 'fan_orig.html') | |
plotData(tempExternal, x, 'temp_external.html') | |
plotData(fanspeedExternal, x, 'fan_external.html') | |
plotData(tempInternal, x, 'temp_internal.html') | |
plotData(fanspeedInternal, x, 'fan_internal.html') | |
plotData(tempBoth, x, 'temp_both.html') | |
plotData(fanspeedBoth, x, 'fan_both.html') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment