basics: how to plot on/off time series?

Posted on
Sat Dec 30, 2017 12:52 pm
dduff617 offline
Posts: 417
Joined: Jul 05, 2006

basics: how to plot on/off time series?

i'm new to marplotlib. have worked a bit in the past with indigoplotd and am experimenting...

a few beginner's requests/questions:

  • can someone suggest a simple recipe to plot a time series depicting a device turning on/off (or boolean state) over time? i was a bit surprised not to see any such example in "gallery" page of docs...
  • how about depicting multiple devices turning on/off on the same time axis?
  • is data in matplotlib always sampled at regular time intervals?
  • also, it appears that csv-engine has a fixed/constant sample interval (5mins) is that correct?
  • is it possible to just plot from a sparse set of on/off events?
  • anyone tried interfacing matplotlib with sql-logger plugin ... or am somehow i barking up the wrong tree here?
I'm' looking to visualize the state of my HVAC system over time showing when pumps and fans run. I'm interested in seeing devices changing state and for example being able to see time between ON/OFF events for some devices. Offhand, just having state snapshots every 5 minutes (as it seems I would get using CSV-engine) doesn't feel like its going to work for what I need. Perhaps I'm missing something.... Should I set about to write python or whatever to generate my own CSV files?

Posted on
Sat Dec 30, 2017 3:44 pm
DaveL17 offline
User avatar
Posts: 4308
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: basics: how to plot on/off time series?

Hi dduff617 -- thanks for giving the plugin a try. I'll try to address each of your questions in turn.

can someone suggest a simple recipe to plot a time series depicting a device turning on/off (or boolean state) over time? i was a bit surprised not to see any such example in "gallery" page of docs...

You're right, there's no on/off image example on the wiki page, but it wouldn't be any different than plotting any other numeric data. The values would be limited to 0 and 1, but otherwise the same.

how about depicting multiple devices turning on/off on the same time axis?

You can plot up to four data sources on a line chart.

is data in matplotlib always sampled at regular time intervals?

See the next question/answer.

also, it appears that csv-engine has a fixed/constant sample interval (5mins) is that correct?

The CSV Engine is limited to standard recording intervals, but you can plot your own CSV data using the plugin and record that data at whatever intervals you choose.

is it possible to just plot from a sparse set of on/off events?

Sure!

anyone tried interfacing matplotlib with sql-logger plugin ... or am somehow i barking up the wrong tree here?

There is no direct facility to interface the two together that I'm aware of, but there is a scripting facility with the plugin where you can send your own data via a python call.

Should I set about to write python or whatever to generate my own CSV files?

That may be your best bet, but the outcome will still be somewhat limited based on the above answers.

I originally wrote the plugin to provide a simple way of constructing a set of charts that would carry the same look and feel and be an easy way to display information on control pages. It wasn't really designed to do complex analysis across multiple devices or complex criteria. Some users are creating transparent charts with similar settings and placing them on top of each other to achieve a bit of what you're after.

Some of what you want to do can be done by constructing your own CSV data. Even more can be done by using the plugin scripting facility. But I don't think that the plugin is capable of doing everything you want to do.

Please feel free to come back with any questions or suggestion for enhancements.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 1 guest