Page 1 of 1

Plot start / X-Axis major & minor ticks?

PostPosted: Mon Mar 20, 2017 5:32 am
by autolog
I have developed a small script that monitors a motion detector and indicates when any motion is detected in a 15 minute period for displaying in a chart.

An example of the chart is:
example_motion_chart.png
Motion Chart
example_motion_chart.png (34.58 KiB) Viewed 1197 times
I wanted the the x-axis ticks to appear beneath the line. So as an experiment, I added a 'direction': 'out' to the k_major_x dictionary. This seems to work but it would be nice to specify it as a config option. If the ticks are inside, they tend to get lost/overwritten by the data columns.

I would also like the minor ticks (every 15 minutes) to display.

The CSV data (sample) is like this:
Code: Select all
Timestamp,Motion Detected
"2017-03-20 00:00:00.000000","0"
"2017-03-20 00:15:00.000000","0"
"2017-03-20 00:30:00.000000","0"
<SNIP>
"2017-03-20 08:30:00.000000","0"
"2017-03-20 08:45:00.000000","0"
"2017-03-20 09:00:00.000000","0.9"
"2017-03-20 09:15:00.000000","0.9"
"2017-03-20 09:30:00.000000","0"
"2017-03-20 09:45:00.000000","0.9"
"2017-03-20 10:00:00.000000","0"
"2017-03-20 10:15:00.000000","0"
"2017-03-20 10:30:00.000000","0.9"
"2017-03-20 10:45:00.000000","0.9"
"2017-03-20 11:00:00.000000","0"
"2017-03-20 11:15:00.000000","0"
"2017-03-20 11:30:00.000000","0"
<SNIP>
"2017-03-20 22:00:00.000000","0"
"2017-03-20 22:15:00.000000","0"
"2017-03-20 22:30:00.000000","0"
"2017-03-20 22:45:00.000000","0"
"2017-03-20 23:00:00.000000","0"
"2017-03-20 23:15:00.000000","0"
"2017-03-20 23:30:00.000000","0"
"2017-03-20 23:45:00.000000","0"
The data is pre-filled for the day (just after midnight). There are 97 entries (1 header + 96 data = 4 entries for every hour e.g. every 15 minutes). If motion is detected in a 15 minute period, then that entry gets set to the value 0.9.

Ideally the chart would start at 00:00 and end at 24:00 with major ticks every 4 hours and minor ticks every 15 minutes. At the moment the chart area seems to start at 23:00 and end at 01:00. Is this possible to modify?

This plugin is a great way to get an instant visualisation of when motion is detected. :D

Re: Plot start / X-Axis major & minor ticks?

PostPosted: Mon Mar 20, 2017 6:02 am
by DaveL17
There's almost always a way. :D

Let's take this offline and we can work on a solution that makes sense for you. Once we get it right, we can bring it back here. I'll look at your other request first and then we can start on this.