... ...

Anagram Solver Solar Artwork

TuftedPuffin.co.uk

... ...

 

... ...
 

Live Data

Live

Today

Yesterday

Energy

PV

Electricity Usage

Write Up

Introduction

OneWire

Scripts

Mysql

Gnuplot

Energy

Theoretical

SVG

Behaviour

PV Monitor

Current Monitor

Bandwidth Monitor

Gnuplot

I use gnuplot to generate all of the graphs on this website, this is the first time I've used this utility and I am quite impressed by how easy it is to use.

Gnuplot is available the normal Ubuntu repositories and can easily be downloaded and installed using Synaptic

By default gnuplot will assign arbitrary colours to each line on the chart, I wanted to keep the colour of each line the same on each of the different charts, so I created a "include" file where I assign fixed line style attributes for each of the lines that I want to plot. This file also contains the commands to setup a standard format chart.


# Gnuplot script file for setting defaults"

load "colours.p"

set terminal png
set xdata time
set timefmt '%Y-%m-%d %H:%M:%S'
set format x "%H"
set autoscale # scale axes automatically
set key left
unset log # remove any log-scaling
unset label # remove any previous labels
set xtic auto # set xtics automatically
set ytic auto # set ytics automatically
set xlabel "Time"

StyleSunEle = 1
StyleSunAzi = 2
StyleSunStrength = 3
StyleSunPower = 4
StyleReferencePanel = 5
StyleCollectorReturn = 6
StyleCollectorFeed = 7
StyleColdWaterIn = 8
StyleBottomOfTank = 9
StyleTwixtSolar = 10
StyleMidTank = 11
StyleTwixtGas = 12
StyleTopOfTank = 13
StyleHotWaterOut = 14
StyleSolarIn = 15
StyleSolarOut = 16
StyleGasIn = 17
StyleGasOut = 18
StyleStudy = 19
StyleLarder = 20
StyleColdWaterTanks = 21
StyleBedroom = 22
StyleLoft = 23
StyleLounge = 24
StyleOutside = 25
StyleSmallBedroom = 26
StyleHall = 27
StyleEnergyStored = 28
StyleWindDirection = 29
StyleWindSpeed = 30
StyleRainHr = 31
StyleOAT = 32
StyleHumidity = 33
StyleDewp = 34
StyleChill = 35
StyleWorkshop = 36

solid = 1
dashed = 2
dotted = 3
dotdahsed = 4

set style line StyleSunEle linecolor rgbcolor Yellow
set style line StyleSunAzi linecolor rgbcolor Gold
set style line StyleSunStrength linecolor rgbcolor Goldenrod
set style line StyleSunPower linecolor rgbcolor DarkGoldenrod
set style line StyleReferencePanel linecolor rgbcolor IndianRed
set style line StyleCollectorReturn linecolor rgbcolor SandyBrown
set style line StyleCollectorFeed linecolor rgbcolor Firebrick
set style line StyleColdWaterIn linecolor rgbcolor MidnightBlue
set style line StyleBottomOfTank linecolor rgbcolor SlateBlue
set style line StyleTwixtSolar linecolor rgbcolor DeepSkyBlue
set style line StyleMidTank linecolor rgbcolor Salmon
set style line StyleTwixtGas linecolor rgbcolor DarkOrange
set style line StyleTopOfTank linecolor rgbcolor Tomato
set style line StyleHotWaterOut linecolor rgbcolor Red
set style line StyleSolarIn linecolor rgbcolor DarkGreen
set style line StyleSolarOut linecolor rgbcolor SeaGreen
set style line StyleGasIn linecolor rgbcolor DimGray
set style line StyleGasOut linecolor rgbcolor SlateGray
set style line StyleStudy linecolor rgbcolor ForestGreen
set style line StyleLarder linecolor rgbcolor Aquamarine
set style line StyleColdWaterTanks linecolor rgbcolor Blue
set style line StyleBedroom linecolor rgbcolor DeepPink
set style line StyleLoft linecolor rgbcolor MediumPurple
set style line StyleLounge linecolor rgbcolor Red
set style line StyleOutside linecolor rgbcolor Brown
set style line StyleSmallBedroom linecolor rgbcolor Coral
set style line StyleHall linecolor rgbcolor Burlywood
set style line StyleEnergyStored linecolor rgbcolor LimeGreen
set style line StyleWindDirection linecolor rgbcolor MidnightBlue
set style line StyleWindSpeed linecolor rgbcolor SteelBlue
set style line StyleRainHr linecolor rgbcolor Blue
set style line StyleOAT linecolor rgbcolor Brown
set style line StyleHumidity linecolor rgbcolor CadetBlue
set style line StyleDewp linecolor rgbcolor Green
set style line StyleChill linecolor rgbcolor DarkGreen
set style line StyleWorkshop linecolor rgbcolor DarkGoldenrod

This file in turn loads another file where the colours are defined


# = "#colour names came from http://www.tayloredmktg.com/rgb/#OR"

Snow = "#fffafa "
Snow2 = "#eee9e9 "
Snow3 = "#cdc9c9 "
Snow4 = "#8b8989 "
GhostWhite = "#f8f8ff "
WhiteSmoke = "#f5f5f5 "
Gainsboro = "#dccdc "
FloralWhite = "#fffaf0 "
OldLace = "#fdf5e6 "
Linen = "#faf0e6 "
AntiqueWhite = "#faebd7 "
AntiqueWhite2 = "#eedfcc "
AntiqueWhite3 = "#cdc0b0 "
AntiqueWhite4 = "#8b8378 "
PapayaWhip = "#ffefd5 "
BlanchedAlmond = "#ffebcd "
Bisque = "#ffe4c4 "
Bisque2 = "#eed5b7 "
Bisque3 = "#cdb79e "
Bisque4 = "#8b7d6b "
PeachPuff = "#ffdab9 "
PeachPuff2 = "#eecbad "
PeachPuff3 = "#cdaf95 "
PeachPuff4 = "#8b7765 "
NavajoWhite = "#ffdead "
Moccasin = "#ffe4b5 "
Cornsilk = "#fff8dc "
Cornsilk2 = "#eee8dc "
Cornsilk3 = "#cdc8b1 "
Cornsilk4 = "#8b8878 "
Ivory = "#fffff0 "
Ivory2 = "#eeeee0 "
Ivory3 = "#cdcdc1 "
Ivory4 = "#8b8b83 "
LemonChiffon = "#fffacd "
Seashell = "#fff5ee "
Seashell2 = "#eee5de "
Seashell3 = "#cdc5bf "
Seashell4 = "#8b8682 "
Honeydew = "#f0fff0 "
Honeydew2 = "#e0eee0 "
Honeydew3 = "#c1cdc1 "
Honeydew4 = "#838b83 "
Mint = "#Cream f5fffa "
Azure = "#f0ffff "
AliceBlue = "#f0f8ff "
Lavender = "#e6e6fa "
LavenderBlush = "#fff0f5 "
MistyRose = "#ffe4e1 "
White = "#ffffff "
Black = "#000000 "
DarkSlateGray = "#2f4f4f "
DimGray = "#696969 "
SlateGray = "#708090 "
LightSlateGray = "#778899 "
Gray = "#bebebe "
LightGray = "#d3d3d3 "
MidnightBlue = "#191970 "
Navy = "#000080 "
CornflowerBlue = "#6495ed "
Dark = "#SlateBlue 483d8b "
SlateBlue = "#6a5acd "
MediumSlateBlue = "#7b68ee "
LightSlateBlue = "#8470ff "
MediumBlue = "#0000cd "
RoyalBlue = "#4169e1 "
Blue = "#0000ff "
DodgerBlue = "#1e90ff "
DeepSkyBlue = "#00bfff "
SkyBlue = "#87ceeb "
LightSkyBlue = "#87cefa "
SteelBlue = "#4682b4 "
LightSteelBlue = "#b0c4de "
LightBlue = "#add8e6 "
PowderBlue = "#b0e0e6 "
PaleTurquoise = "#afeeee "
DarkTurquoise = "#00ced1 "
MediumTurquoise = "#48d1cc "
Turquoise = "#40e0d0 "
Cyan = "#00ffff "
LightCyan = "#e0ffff "
CadetBlue = "#5f9ea0 "
MediumAquamarine = "#66cdaa "
Aquamarine = "#7fffd4 "
DarkGreen = "#006400 "
DarkOliveGreen = "#556b2f "
DarkSeaGreen = "#8fbc8f "
SeaGreen = "#2e8b57 "
MediumSeaGreen = "#3cb371 "
LightSeaGreen = "#20b2aa "
PaleGreen = "#98fb98 "
SpringGreen = "#00ff7f "
LawnGreen = "#7cfc00 "
Chartreuse = "#7fff00 "
MediumSpringGreen = "#00fa9a "
GreenYellow = "#adff2f "
LimeGreen = "#32cd32 "
YellowGreen = "#9acd32 "
ForestGreen = "#228b22 "
OliveDrab = "#6b8e23 "
DarkKhaki = "#bdb76b "
Khaki = "#f0e68c "
PaleGoldenrod = "#eee8aa "
LightGoldenrod = "#fafad2 "
LightYellow = "#ffffe0 "
Yellow = "#ffff00 "
Gold = "#ffd700 "
LightGoldenrod = "#eedd82 "
Goldenrod = "#daa520 "
DarkGoldenrod = "#b8860b "
RosyBrown = "#bc8f8f "
IndianRed = "#cd5c5c "
SaddleBrown = "#8b4513 "
Sienna = "#a0522d "
Peru = "#cd853f "
Burlywood = "#deb887 "
Beige = "#f5f5dc "
Wheat = "#f5deb3 "
SandyBrown = "#f4a460 "
Tan = "#d2b48c "
Chocolate = "#d2691e "
Firebrick = "#b22222 "
Brown = "#a52a2a "
DarkSalmon = "#e9967a "
Salmon = "#fa8072 "
LightSalmon = "#ffa07a "
Orange = "#ffa500 "
DarkOrange = "#ff8c00 "
Coral = "#ff7f50 "
LightCoral = "#f08080 "
Tomato = "#ff6347 "
Orange = "#Red ff4500 "
Red = "#ff0000 "
HotPink = "#ff69b4 "
DeepPink = "#ff1493 "
Pink = "#ffc0cb "
LightPink = "#ffb6c1 "
PaleVioletRed = "#db7093 "
Maroon = "#b03060 "
MediumVioletRed = "#c71585 "
VioletRed = "#d02090 "
Violet = "#ee82ee "
Plum = "#dda0dd "
Orchid = "#da70d6 "
MediumOrchid = "#ba55d3 "
DarkOrchid = "#9932cc "
DarkViolet = "#9400d3 "
BlueViolet = "#8a2be2 "
Purple = "#a020f0 "
MediumPurple = "#9370db "
Thistle = "#d8bfd8 "
Green = "#00ff00 "

I have yet to settle on the line colours that give me the best line disctinction on each of the charts

Each chart is generated using its own gnuplot control file, for instance the chart for today's cylinder temperature is :-


# This file is called cylinderToday.p

load "default.p"

set title "Water Cylinder Temperature (Today)"
set ylabel "Degrees (C)"
set yr [10:75]

plot "today.out" using 1:27 title 'HotWaterOut' with lines ls StyleHotWaterOut, \
"today.out" using 1:21 title 'TopOfTank' with lines ls StyleTopOfTank, \
"today.out" using 1:24 title 'TwixtGas' with lines ls StyleTwixtGas, \
"today.out" using 1:19 title 'MidTank' with lines ls StyleMidTank, \
"today.out" using 1:20 title 'TwixtSolar' with lines ls StyleTwixtSolar, \
"today.out" using 1:23 title 'TankBottom' with lines ls StyleBottomOfTank, \
"today.out" using 1:26 title 'ColdWaterIn' with lines ls StyleColdWaterIn

One thing that did cause me a little bit of confusion at first was the fact that the date and time columns are treated as one column (because of the timefmt definitio) but are counted as 2 columns when accessing the data.

Energy

This page is best viewed using Firefox Spread Firefox Affiliate Button

 

... ...