Matplotlib Plugin for Indigo 7 - New!

Posted on
Sat Mar 18, 2017 11:56 am
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

OK thanks. And yes, after that first hour, it has definitley not done any of that rapid cycling. Just getting the expected q15 m polling.

I have just started playing with it, but it seems really cool so far. Thanks for putting it together. I haven't yet explored the advanced settings, but I would expect I might use custom colors and line segments for some applications.

I actually think I need to start over a bit, as my original chart sizes were too small. But when I re-sized them in the plugin device (but didn't change the .png name) it's making the control page item act wonky when displayed on the phone. I think I need to re-name the output and link the control page to the new name to solve this.

A few ideas for future iterations (I am not a developer and have literally no Python experience, so these may be way outsdie of what is worth the effort):

1) Dual Y axes on a single chart (or a way to have a non linear break). I may be using the wrong terms there. But for example, and to stay with my somewhat lame internet speedtest example, this would allow you to plot both upload speed (typically b/w say 4-12 mbs in my results) and download speed (more like 60-150 mbs) on the same graph. I could of course do this now, but the upload speed would likely just be an almost flat line on a y axis set up from 0-180 or so to accommodate the download speed.

2) A way to have the legend items appear over the actual data in the chart. For example, I set up a temp graph for my upstairs and downstairs thermostats, and did them on the same line chart, and I enabled a legend, with the two thermostats in different colors. It would be cool if instead of the legend under the chart, I could just label the upstairs line "upstairs" right below the first few readings (I'd match text color to line color) and label the downstairs line "downstairs" maybe above that line. Or some permutation of that.


Again, I've only just begun playing around with this, so take my thoughts with a grain of salt.

Thanks again for making a cool new addition to the Indigo ecosystem.
Attachments
Screen Shot 2017-03-18 at 1.53.50 PM.png
Screen Shot 2017-03-18 at 1.53.50 PM.png (38.26 KiB) Viewed 3760 times

Posted on
Sat Mar 18, 2017 3:39 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Professor Falken wrote:
OK thanks. And yes, after that first hour, it has definitley not done any of that rapid cycling. Just getting the expected q15 m polling.


Good. Sounds like things are working the way they should. That's good news.

I have just started playing with it, but it seems really cool so far. Thanks for putting it together. I haven't yet explored the advanced settings, but I would expect I might use custom colors and line segments for some applications.


Please let me know what you think when you start to enable some of the advanced settings. To be honest, most of them aren't that advanced, they're just ways to supplement the defaults.

I actually think I need to start over a bit, as my original chart sizes were too small. But when I re-sized them in the plugin device (but didn't change the .png name) it's making the control page item act wonky when displayed on the phone. I think I need to re-name the output and link the control page to the new name to solve this.


Yeah, there are some issues when we change the dimensions of graphic files in Indigo--especially with Indigo Touch. This is a known behavior and there's a fair bit of discussion on the boards with pointers to help address the issue.

A few ideas for future iterations (I am not a developer and have literally no Python experience, so these may be way outsdie of what is worth the effort):

1) Dual Y axes on a single chart (or a way to have a non linear break). I may be using the wrong terms there. But for example, and to stay with my somewhat lame internet speedtest example, this would allow you to plot both upload speed (typically b/w say 4-12 mbs in my results) and download speed (more like 60-150 mbs) on the same graph. I could of course do this now, but the upload speed would likely just be an almost flat line on a y axis set up from 0-180 or so to accommodate the download speed.


Dual Y axes are definitely on the request list. It's a little bit more complicated when you make them optional. What I'm leaning towards is a separate device type, but that is suboptimal to be sure. Will be looking to add this feature in the future.

2) A way to have the legend items appear over the actual data in the chart. For example, I set up a temp graph for my upstairs and downstairs thermostats, and did them on the same line chart, and I enabled a legend, with the two thermostats in different colors. It would be cool if instead of the legend under the chart, I could just label the upstairs line "upstairs" right below the first few readings (I'd match text color to line color) and label the downstairs line "downstairs" maybe above that line. Or some permutation of that.


Also on the request list. I'm leaning towards having a set of legend parameters to allow finer grained control.

These are both great ideas--please keep them coming. The trade off with features is the balance between function and ease of use. There's a nearly infinite number of options and permutations with Matplotlib and the trick is to try to hit the nail on the head with that balance.

Enjoy!

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

[My Plugins] - [My Forums]

Posted on
Sat Mar 18, 2017 3:41 pm
Professor Falken offline
User avatar
Posts: 289
Joined: Mar 29, 2015

Re: Matplotlib Plugin for Indigo 7 - New!

OK, so I see on this chart on your github page that there clearly is a way to do 2 different y axes, so I guess I need to dig a little more to make that work.

Image

But I have another question based on the same graph. It appears that there is one reading per day charted for this data, which makes sense given that a high/low is the same all day. How do I do that? On the couple of graphs I've made so far, I get a flat line representing a reading every 15 minutes until a data point changes and there is sudden change. But how would I plot something, say, just once a day, or maybe every 6 hours or something. Did you have to set the global data polling to once a day for that graph, or is there a simple setting within the chart or the data engine for less frequent data points?


Again, thanks for all the help getting this working.

Posted on
Sat Mar 18, 2017 5:08 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

That one is a "special" chart type linked to the WUnderground Plugin. It's the 10-day Forecast Device chart (there's also a 24-hour Forecast version.) To use those, you'll also need to use the WUnderground plugin. :D

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

[My Plugins] - [My Forums]

Posted on
Fri Apr 14, 2017 12:00 pm
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Dave

Just to let you know I updated to 0.4.08 today and ran into these errors

Matplotlib Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 2946, in runConcurrentThread
File "plugin.py", line 1213, in refreshTheCharts
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 1210, in critical
TypeError: _log() got an unexpected keyword argument 'isError'

Matplotlib Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Have gone back to previous version.

Posted on
Fri Apr 14, 2017 12:28 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Busta999 wrote:
Dave

Just to let you know I updated to 0.4.08 today and ran into these errors

Matplotlib Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 2946, in runConcurrentThread
File "plugin.py", line 1213, in refreshTheCharts
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 1210, in critical
TypeError: _log() got an unexpected keyword argument 'isError'

Matplotlib Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)

Have gone back to previous version.

Thanks for the report. That's a byproduct of going back and forth between developing for Indigo 7 and Indigo 6, and completely my fault. I will fix for the next release.

Dave

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

[My Plugins] - [My Forums]

Posted on
Fri Apr 14, 2017 12:53 pm
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Thanks, your work on this is much appreciated


Sent from my iPad using Tapatalk

Posted on
Fri Apr 14, 2017 1:56 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Glad that you're finding the plugin useful.


Sent from my iPhone using Tapatalk

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

[My Plugins] - [My Forums]

Posted on
Thu Apr 20, 2017 1:41 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Started getting a load of errors coming up inn the log.

Had a power outage last night, but everything was up and running OK until 3:46am this morning when the graphs stopped being updated.

Here is a sample of the errors

[/code]Matplotlib Critical Error Chart - Electricity Consumed: Error plotting chart (RRuleLocator estimated to generate 2005 ticks from 2017-01-29 21:44:11.214326+00:00 to 2017-04-23 10:50:41.427676+00:00: exceeds Locator.MAXTICKS * 2 (2000) )
Matplotlib Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 2861, in runConcurrentThread
File "plugin.py", line 1188, in refreshTheCharts
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.py", line 561, in savefig
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 1421, in savefig
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backend_bases.py", line 2220, in print_figure
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_agg.py", line 505, in print_png
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_agg.py", line 451, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 1034, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line 2086, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 1091, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 945, in _update_ticks
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 895, in iter_ticks
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/dates.py", line 636, in __call__
RuntimeError: RRuleLocator estimated to generate 2005 ticks from 2017-01-29 21:44:11.214326+00:00 to 2017-04-23 10:50:41.427676+00:00: exceeds Locator.MAXTICKS * 2 (2000)

Matplotlib Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)[/code]

Posted on
Thu Apr 20, 2017 1:43 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Started getting a load of errors coming up inn the log.

Had a power outage last night, but everything was up and running again OK until 3:46am this morning when the graphs stopped being updated.

Here is a sample of the errors

[/code]Matplotlib Critical Error Chart - Electricity Consumed: Error plotting chart (RRuleLocator estimated to generate 2005 ticks from 2017-01-29 21:44:11.214326+00:00 to 2017-04-23 10:50:41.427676+00:00: exceeds Locator.MAXTICKS * 2 (2000) )
Matplotlib Error Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
File "plugin.py", line 2861, in runConcurrentThread
File "plugin.py", line 1188, in refreshTheCharts
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/pyplot.py", line 561, in savefig
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 1421, in savefig
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backend_bases.py", line 2220, in print_figure
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_agg.py", line 505, in print_png
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/backends/backend_agg.py", line 451, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/figure.py", line 1034, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axes.py", line 2086, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/artist.py", line 55, in draw_wrapper
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 1091, in draw
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 945, in _update_ticks
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/axis.py", line 895, in iter_ticks
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/matplotlib/dates.py", line 636, in __call__
RuntimeError: RRuleLocator estimated to generate 2005 ticks from 2017-01-29 21:44:11.214326+00:00 to 2017-04-23 10:50:41.427676+00:00: exceeds Locator.MAXTICKS * 2 (2000)

Matplotlib Error plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)[/code]

I have disabled the plugin and re-enabled it - same errors

I have disabled the plugin for the moment.

Any suggestions/thoughts/insights?

Posted on
Thu Apr 20, 2017 5:47 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Busta999 wrote:
Any suggestions/thoughts/insights?


Hi Busta999 - yes, that means that one or more of your data files is "corrupt". It's typically one of two things: 1) one or more of the data files is not properly constructed--usually a missing comma or missing line feed, or 2) the date range reflected in the data file is too long--causing matplotlib to try to "fill in the blanks". When I've seen this error, it's typically the latter.

There's a couple things that you can do. The easiest is to delete the CSV file(s) that are causing the problem. The plugin should pick up where it left off and start plotting from that point forward (this is typically the route I take in the rare case that I see this error.) The second is, if you are comfortable with it, is to manually edit the file(s) directly to correct whatever problem is there. When I try this route, I usually just delete the offending rows if the fix isn't obvious.

What this means for me is that I need to add a better trap so that the plugin doesn't fail as a result of bad source data.

Let me know if you need more help.
Dave

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

[My Plugins] - [My Forums]

Posted on
Wed May 10, 2017 2:42 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

Dave

Took me a while to return to you, sorry been distracted ..

The CSV file was being created by Matplotlib so not sure where the bad data originated.

I deleted the bad ones.

This all started when I had a power cut and the Mac went down.

Mike

Posted on
Wed May 10, 2017 3:50 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Busta999 wrote:
Dave

Took me a while to return to you, sorry been distracted ..

The CSV file was being created by Matplotlib so not sure where the bad data originated.

I deleted the bad ones.

This all started when I had a power cut and the Mac went down.

Mike

Thanks for letting me know.

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

[My Plugins] - [My Forums]

Posted on
Sat Jul 22, 2017 3:38 am
Busta999 offline
User avatar
Posts: 714
Joined: Mar 30, 2016
Location: Wales UK

Re: Matplotlib Plugin for Indigo 7 - New!

hi

anyone any insight into these error messages?

Code: Select all
      Stopping plugin Matplotlib (pid 77464)
   Stopped plugin Matplotlib
   Upgrading plugin Matplotlib to newer version 0.4.08 (previous version moved to trash)
   Loading plugin "Matplotlib 0.4.08"
   Starting plugin "Matplotlib 0.4.08" (pid 77962)
   Started plugin "Matplotlib 0.4.08"
   Updated                         "Hallway (new)" on to 49
   Updated                         "Hallway Group" on to 49
   Matplotlib Warning              Chart - Cleaning Robot Power: X axis label is suppressed to make room for the chart legend.
   Matplotlib Warning              Chart - Daily Power Usage: X axis label is suppressed to make room for the chart legend.
   Matplotlib Warning              Chart - Hue Luminance: X axis label is suppressed to make room for the chart legend.
   Matplotlib Error                Error in plugin execution runConcurrentThread:

Traceback (most recent call last):
  File "plugin.py", line 2946, in runConcurrentThread
  File "plugin.py", line 1213, in refreshTheCharts
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/logging/__init__.py", line 1210, in critical
TypeError: _log() got an unexpected keyword argument 'isError'
Matplotlib Error   plugin runConcurrentThread function returned or failed (will attempt again in 10 seconds)




It is certainly filling the log quickly :-)

Posted on
Sat Jul 22, 2017 5:10 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Matplotlib Plugin for Indigo 7 - New!

Code: Select all
TypeError: _log() got an unexpected keyword argument 'isError'
That's one where I converted a standard error logging command to a debug logging command (but forgetting to remove the isErrror parameter).

Please go ahead and download the latest version (v0.4.08) and see if the error clears. It's marked as a pre-release version, but it's been running since April and appears to be stable. I'll be trotting out a new formal release soon.

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

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 4 guests