Page 2 of 2

Re: Chart Not Drawing

PostPosted: Sat Oct 24, 2020 4:32 am
by DaveL17
Yeah, I think that's all part of the same bug. According to the developers, this issue has been fixed in newer versions of matplotlib-- we're using a much older version that ships with our machines.

Try this updated version of the plugin which includes the new setting to force the chart to display leading and/or trailing zero bars. This is a pre-release build that includes other refinements so you may see a minor bug unrelated to this issue. Please let me know how it works for you.

Screen Shot 2020-10-24 at 5.27.14 AM.png
Screen Shot 2020-10-24 at 5.27.14 AM.png (31.98 KiB) Viewed 2680 times

Re: Chart Not Drawing

PostPosted: Sat Oct 24, 2020 8:40 am
by jltnol
Downloaded and installed.

I'll know how it works in a day or two.

Thanks!

Re: Chart Not Drawing

PostPosted: Sun Oct 25, 2020 9:50 pm
by jltnol
So the first pic are the CVS values, and the 2nd is the chart drawn with the new option checked.

Re: Chart Not Drawing

PostPosted: Mon Oct 26, 2020 4:43 am
by DaveL17
Aha. I made the change to control for the number of bars based on the number of observations in the data file. Obviously, that's not going to work here because each data file is one observation long. To be honest, I never envisioned data being provided quite this way. The "easy" fix would be to provide all the data in one CSV file, but there may be a way for me to work around this. Please stand by.

Re: Chart Not Drawing

PostPosted: Thu Oct 29, 2020 1:09 pm
by DaveL17
Wanted to give you an update to make sure you didn't think I was ignoring you.

I may be on to a solution, but I still need to do some regression testing to make sure that I haven't designed something that will work for you but not for everybody else. :D

chart_bar_zero_bar_test.png
chart_bar_zero_bar_test.png (10.53 KiB) Viewed 2615 times

Re: Chart Not Drawing

PostPosted: Sun Nov 01, 2020 7:07 am
by DaveL17
Looks like my optimism was unfounded. Unfortunately, given the large number of possible inputs, it looks pretty improbable that I'll be able to code around this Matplotlib bug. Looks like the best bet would be to adjust your scripts to change how zero values are handled. You should continue to set zero values to something super small, like '1.0e-06' or '0.000001'. I'll be changing the way that the Show Zero Bars setting works and will have the plugin literally change the zero values for you.

Sorry I couldn't come up with a better solution.

Re: Chart Not Drawing

PostPosted: Tue Nov 03, 2020 1:01 pm
by DaveL17
I have posted a pre-release of the zero bar fix that should address this issue.

https://forums.indigodomo.com/viewtopic.php?f=219&t=17349&p=196562#p196562

Re: Chart Not Drawing

PostPosted: Thu Nov 12, 2020 11:17 am
by jltnol
Hey Dave

Sorry for the late reply.

Nothing to worry about... I've gotten things to write as 0.01, and that pretty much works for me.

However, I could EASILY put all my data into one cvs file, but don't have the python chops to make that happen. Here is the code you suggested I use to create my four files:
Code: Select all
csv_path = '/Users/bradford/MatPlotLib/'  # put your CSV Engine data path here
values = {
    'RainToday': ('1970-01-01 00:00:00.000000,', indigo.variables[1852577407].value),  # change these variable ids to match yours
    'RainYesterday': ('1970-01-02 00:00:00.000000,', indigo.variables[35080668].value),
    'RainThisWeek': ('1970-01-03 00:00:00.000000,', indigo.variables[986779847].value),
    'RainThisMonth': ('1970-01-04 00:00:00.000000,', indigo.variables[1169660509].value),
   }

for key in values.keys():

    with open(csv_path + key + ".csv", 'w') as outfile:
        outfile.write("Timestamp," + key + "\n")
        outfile.write(values[key][0] + values[key][1])



I've tried several different ways to combine the value from the 4 variables into a single CVS file, but this is way past my understanding and ability. I've given thought to ways to create a new CVS Engine to gather those 4 values, but anyway I slice it, I'm still ending up with 4 different CVS files. In my perfect world, a trigger would grab those values from the 4 variables and put them into a single CVS file, and subsequent trigger events would replace the values, not add more data to the CVS file.

Regardless, thanks again so much for taking time to look into this for me.


JT

Re: Chart Not Drawing

PostPosted: Thu Nov 12, 2020 3:36 pm
by DaveL17
HI JT - the latest revisions to that part of the code should handle the zero data issue right out of the box.

That said, you could still combine all the data into one file if you wanted to. If that's what you want to do, I could help gin up the script to make that happen, but that would force all the bars to be the same color (they would all be bar 1 data).