INDIGOplotD -- a plot tool for indigo

A Plugin to create Plots from INDIGO data and other sources
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by autolog »

Hi Karl,
Just to repeat my sincere thanks for your hard work in getting this to work for postgreSQL :D

Here is my very first test plot produced from my SQL Logger postgreSQL database using the psql options in indigoPlotD:
psql plot example
psql plot example
postgreSQLplot.png (17.73 KiB) Viewed 4740 times
I now have to read the PDF documentation to educate myself on how to get the best out of indigoPlotD :wink:
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

for better looks: you could to try to smooth the temp curve (in plot/lines, expert on /select temp line to edit/ select soft smooth )
autolog
Posts: 4077
Joined: Tue Sep 10, 2013 3:07 am
Location: West Sussex, UK
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by autolog »

Ok - Here is my revised attempt:
psql plot example 2
psql plot example 2
postgreSQLplot.png (29.88 KiB) Viewed 4725 times
Now I must read the manual :)
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

I would put the "ON" to the right axis and label with:

YscaleRight 0:100
YRight tics: "OFF"0,"ON"10,20,30,40,50,60,70,80,90,100

the set for the on/off line:
offset:0
mult:10
use hist color red

with that you can have the ONOFF label on the right scale and also use it for centigrades
just a pointer for not so obvious options..


Karl

the format for tics :
1,2,3,4,"text"5,6,7,8,"top"10

will replace the numbers with the text in quotes for that tic, so instead of 5 >>text<< is shown and instead of 10 >>top<<
jtodd
Posts: 76
Joined: Tue Apr 15, 2014 5:59 pm

Re: INDIGOplotD -- a plot tool for indigo

Post by jtodd »

Again, I want to say what a great plugin this is. Thanks, Karl! I've burned HOURS of time plotting the heck out of everything, and I haven't even started to get creative with colors and whatnot...

Minor feature request: would it be possible to make graphs "scroll" a bit more smoothly? For instance, when I specify a "1" day interval for my minute graph, I can only see data from 00:00 to <current_time>. It would be really handy to have graphs that display as much data as possible on the screen space provided, meaning the points that would be plotted just inside the right hand border of the graph would be <current_time> values, stretching leftwards for whatever the interval was. This would allow me to see (for instance) the last 24 hours of data, not just data from midnight onwards. My graphs of 1 day interval look pretty empty at half past midnight right now. :-)

Second minor feature request: you have the ability for a whole graph to be offset in the past, which is great. Why not allow that same offset to be applied to lines? It would be useful for me to see yesterday's power usage as a ghost line behind today's power usage, instead of having to look at a whole different chart. If this sounds like a good idea, it would be amazing if you could allow the offset to be specified in minutes instead of a fixed pick-list of intervals.

Bug? I've been unable to get smoothing to work on my "minute" graph pages, specifically on wattages from my energy monitors. The graphs just don't get created, leaving a zero length file for minute pngs. My wattage use is pretty spiky - maybe it's having a hard time digesting the data? I've tried all three smoothing types - they work on the hourly/daily graphs, but not on the minute. If I just pick one value from the 4 on the page and apply any of the smoothing algos, it bombs out and the "minute" graph is empty.

Thanks again!

JT
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

good to hear that you like it.

#1 could be done. Need to think about how get it done. ( other solution: you go to bed before midnight and sleep long )

#2 is a bit more complicated. That would change the whole setup... But ... More than a week of thinking.

# 3. That's up to the smoother in gnuplot or matplot. It looks like it throws the towel. Not much I can do about it. I guess you are using gnuplot Matplot smooth function returns an error and then I do the regular line. In gnu its send and pray


Sent from my iPhone using Tapatalk
jtodd
Posts: 76
Joined: Tue Apr 15, 2014 5:59 pm

Re: INDIGOplotD -- a plot tool for indigo

Post by jtodd »

Thanks for thinking about it!

For #1: Sleep is overrated. :-)

For #2: you mean it would change the whole setup of how your code works, or how the UI works? If the latter, it would seem pretty simple to just add a "Time Offset" field that would be understandable. If the former, then I leave you to it. ... ... Now that I think about it a bit more, maybe the time offset field could be absolute or relative. If I was showing just a single day of data in a simple line plot, for instance, I could add a line with a time offset of "00:00:01 2014/01/24" to show how the current data compares against a specific interesting day in history that I use as my benchmark, or I could specify "-1440" to just show the day prior. Using the fixed date in time of course will result in graphs that repeat if more than one day is shown. I'm not sure if this would require UI hints in the X axis to indicate the date range of the time-shifted lines, or if it is just reasonable to expect the user to note that in their description of the line itself ("Yesterday Watts".) I'm thinking that since it might be possible to add several different time-shifted lines in the same plot, that the user would have to indicate the time intervals in their description of the lines.

For #3: Oh well. I can live without the smoothing.

Lastly, a #4: could it be possible to have a view that is less than 24 hours? There are some values (like watts, for me since I have many sensors and very spiky lines) that I want a smaller section of time shown because I have higher resolution data and it gets really crowded with a 1 day view, even at higher pixel sizes, especially since I can't smooth the lines. If I'm hitting this on the first few graphs I'm making, I'm sure many others are as well.

JT
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

I can easily shift the whole plot window by any amount, shifting a line / data would require

#2) shift data for a single line: currently everything is in one file. first column date/time then the data. This is how GNU likes it. I could need to shift the x-coordinate of a single line. I have tried that, but date numbers are treated differently. Have not figured out how to add 1 day to 20150117000000 it is not + 1000000.
just FYI the GNU command is
using ($1+xx):(($5*multiplier)+Offset)) with lines linetype 6 linewidth 1 linecolor rgb "#000000" title "WindSensor" axis x1y1\
(multiplier & offset are the parameters in the line menu)
have not figured out what xx should be.. If anyone knows let me know, may be it is in seconds..
In MATPLOT I know how to do it. I hand over a field with x/y coordinates.. can do the calculation per line..

#4) the current minimum binning is 5 minutes. THAT IS VERY MUCH HARDWIRED!
BUT you can create your own data set and display that.
if you like I can walk your thought that.
See the PDF file for how to do it. It is actually pretty simple

here a SHORT description.. create a file like this one:
#; y1text; y2text
x; y1; y2
x; y1; y2
...
x y1 y2 are the data you like to plot

put the file into the DATA directory and write the file name into the "plot data from file" field, then in the line section select what you want to do with y1,y2... (line 1, line2 ..)

Karl
jtodd
Posts: 76
Joined: Tue Apr 15, 2014 5:59 pm

Re: INDIGOplotD -- a plot tool for indigo

Post by jtodd »

kw123 wrote:I can easily shift the whole plot window by any amount, shifting a line / data would require
Did this get cut off in mid thought?
kw123 wrote: #2) shift data for a single line: currently everything is in one file. first column date/time then the data. This is how GNU likes it. I could need to shift the x-coordinate of a single line. I have tried that, but date numbers are treated differently. Have not figured out how to add 1 day to 20150117000000 it is not + 1000000.
just FYI the GNU command is
using ($1+xx):(($5*multiplier)+Offset)) with lines linetype 6 linewidth 1 linecolor rgb "#000000" title "WindSensor" axis x1y1\
(multiplier & offset are the parameters in the line menu)
have not figured out what xx should be.. If anyone knows let me know, may be it is in seconds..
In MATPLOT I know how to do it. I hand over a field with x/y coordinates.. can do the calculation per line..
How about just creating a new temporary file in those cases where start/end times are not equal for all lines? Shift things around during creation of the file. Then graph based on the contents of the new file, and throw it away when done. It's slower, to be sure.
kw123 wrote: #4) the current minimum binning is 5 minutes. THAT IS VERY MUCH HARDWIRED!
BUT you can create your own data set and display that.
if you like I can walk your thought that.
See the PDF file for how to do it. It is actually pretty simple

here a SHORT description.. create a file like this one:
#; y1text; y2text
x; y1; y2
x; y1; y2
...
x y1 y2 are the data you like to plot

put the file into the DATA directory and write the file name into the "plot data from file" field, then in the line section select what you want to do with y1,y2... (line 1, line2 ..)
OK, easy enough. How do the dates get handled/shown though? Is there even a date option for the X axis in this method? I'll go try it out, but wanted to put this down on the screen before I vanish for dinner and lose my train of thought.

JT
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

JT

https://www.dropbox.com/s/onvmuqwdkmp2q ... 4.zip?dl=0 -- not officially released.

this one will set the right Y axis to the currenthour+1
so if you have 18:37:10 the right y axis is 19:00:00
in plots pick: minutes shift left: continuous shift right y axis =now
have not fully tested.. but seems to work.

only implemented for the minute plot, for days and hour (i believe) this does not make sense / add value.

Karl

as for the use file otions: here an example of a file from John in the Netherlands with his data. A resulting plot is shown in the download section.

https://www.dropbox.com/s/oy2wjkmznn9sa ... .indi?dl=0
- You need a format string though to describe the data, see attached screen shots.
- The first line with # describes the lines you see in the line section.
Attachments
Screen Shot 2015-01-18 at 10.52.45 PM.png
Screen Shot 2015-01-18 at 10.52.45 PM.png (131.11 KiB) Viewed 4612 times
Screen Shot 2015-01-18 at 10.52.06 PM.png
Screen Shot 2015-01-18 at 10.52.06 PM.png (173.58 KiB) Viewed 4612 times
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

JT:
"How about just creating a new temporary file
:mrgreen: :twisted: :evil: :cry: :oops: :P :x :lol: :roll: :!: :?: :idea:

Karl

would like to do a more elegant solution.. again for MATPLOT this one is "easy" for GNUPLOT I have not figured out the logic. and have not found any discussion on how to do math with dates.
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

for anyone who would like to know: shift time in gnuplot:
use timecolumn(1) instead of $1+#seconds..
>>>
using (timecolumn(1)+60*60*24):3 with lines linetype 6 linewidth 5 linecolor rgb "#FF0000" title "Temp-yesterday" axis x1y1
<<<
will shift the date in column 1 by 24 hours plotting column 3 as Y
i.e. show yesterdays data in todays time window..
and by adding
using 1:3 with lines linetype 6 linewidth 5 linecolor rgb "#0000FF" title "Temp-Today" axis x1y1
the temperature from yesterday and today will be shown on the same plot, one in red the other in blue

JT:
now I can "easily" shift any line forward and backwards.. give me 2 days ..

Karl
jtodd
Posts: 76
Joined: Tue Apr 15, 2014 5:59 pm

Re: INDIGOplotD -- a plot tool for indigo

Post by jtodd »

Excellent news! I'll hold off on the file method, then, and wait for you to toss up a new version here when you get the time. Sounds like you've hit on the right way to do it.

I've converted all my plots to the continuous shift model; seems to work fine, both over hour boundaries and midnight. I'd go so far as to say that this might be the default behavior, instead of having up to 50% of the screen as whitespace which is the condition now with the 2-day plot option.

JT
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

JT,

do you want to see
23..24 hours or 24..25 hours
ie
let's say it is 09:23
should it show 10:00 previous day.. 10:00 today
or 9:00 previous day ..10:00 today?

Karl
User avatar
kw123
Posts: 8705
Joined: Sun May 12, 2013 4:44 pm
Location: Dallas, TX
Contact:

Re: INDIGOplotD -- a plot tool for indigo

Post by kw123 »

https://www.dropbox.com/s/qhgv51zhkc13c ... 5.zip?dl=0 v 3-7-25 not officially released..

JT-- you can now:

shift the whole plot window by x days
shift a single line by x days
set continuos mode to have the right y axis = now instead of shifting at midnight

still testing

Karl

attached 2 plots for a 2 day window
both with 2 lines of outside temperature, one as is and one line shifted right by 1 day, i.e. overlay yesterdays temp onto today.
and the other is in continuous mode. you can see that the yellow line shows "yesterdays afternoon temperature" this afternoon.
Attachments
test-minuteshift 1 day and continuous.png
test-minuteshift 1 day and continuous.png (5.87 KiB) Viewed 4542 times
test-minute shift 1 day.png
test-minute shift 1 day.png (5.58 KiB) Viewed 4542 times
Post Reply

Return to “INDIGOplotD”