Created
December 21, 2014 10:47
-
-
Save joneskoo/7826d564a2b6d91e8e6f to your computer and use it in GitHub Desktop.
Plot power consumption as a function of temperature
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
#!/usr/bin/env gnuplot | |
# sqlite3 | |
# select cast(temp as integer), round(avg(1000*usage), 2) from power group by 1; | |
set terminal png | |
set output "data.png" | |
set datafile separator "," | |
set title "Power consumption as a function of temperature" | |
set ylabel "Watts" | |
set xlabel "Outside temperature (Celsius)" | |
f(x) = a*x + b | |
fit [-20:10] f(x) 'data.txt' using 1:2 via a,b | |
plot "data.txt" title "Power usage", \ | |
f(x) title "linear fit -20..10C" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment