Recreating weather forecast charts

Posted on
Thu Jan 19, 2023 12:27 pm
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Recreating weather forecast charts

Hi Dave,
I'm working towards recreating some of the weather forecast charts now that I'm off FW. I'm trying to create a simple line chart that would low and high temperatures for the next five days. I cobbled together the CSV files in a way that I think makes sense (and have python scripts running to automate this) but the charts never show future dates. The data looks like this:

Code: Select all
Timestamp   Low
2023-01-17 00:04:56.969906   20
2023-01-18 00:04:56.969906   20
2023-01-19 00:04:56.969906   24
2023-01-20 00:04:56.969906   25
2023-01-21 00:04:56.969906   30
2023-01-22 00:04:56.969906   40
2023-01-23 00:04:56.969906   34


Since I did this manually, it's the same time of 7 consecutive days. When I create a line chart of this, it only shows the chart for 1/17, 1/18 and 1/19 (today) but not the future days. Am I missing something in the formatting of the CSV data or do the charts not normally plot future dates?

thanks,
Aldon

Posted on
Thu Jan 19, 2023 3:23 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Hi Aldon - try this and see if it makes a difference (comma separator is required):

Code: Select all
Timestamp   Low
2023-01-17 00:04:56.969906,20
2023-01-18 00:04:56.969906,20
2023-01-19 00:04:56.969906,24
2023-01-20 00:04:56.969906,25
2023-01-21 00:04:56.969906,30
2023-01-22 00:04:56.969906,40
2023-01-23 00:04:56.969906,34

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

[My Plugins] - [My Forums]

Posted on
Thu Jan 19, 2023 6:06 pm
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

Hi Dave,
Sorry, I c&p'd that out of a spreadsheet. In a text editor it looks like:
Code: Select all
Timestamp,Low
2023-01-17 00:04:56.969906,20
2023-01-18 00:04:56.969906,20
2023-01-19 00:04:56.969906,24
2023-01-20 00:04:56.969906,25
2023-01-21 00:04:56.969906,30
2023-01-22 00:04:56.969906,40
2023-01-23 00:04:56.969906,34

Aldon

Posted on
Thu Jan 19, 2023 7:29 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

I'm not sure why you're seeing what you're seeing, but it's working for me. Try creating a new line chart device with no options and see what you get.
Attachments
aldon.png
aldon.png (14.54 KiB) Viewed 1525 times

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

[My Plugins] - [My Forums]

Posted on
Thu Jan 19, 2023 10:03 pm
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

Hmmm... Well, that worked. :oops:

Two additional questions
-Is there a way to control the display of the annotation? I have data that is an integer (e.g. 26) but when I have annotation on, it shows 26.0. I'd like to get rid of the decimal. The precision for the Y Axis is '0 (#)*'.

-I assume the Custom Line Segments will just draw a horizontal line with the parameters given. For example, if I wanted to draw a white line at 32 degrees, I would enter (32 "white"). I do that and I don't see anything on the re-drawn chart.

Aldon

Posted on
Fri Jan 20, 2023 7:27 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Glad to hear that you were able to get a functional plot.

Q1: There is currently no precision adjustment for individual annotations. I would have to hit the archives, but I seem to remember it was in there at some point, so it might have been removed. I could be imagining that, however. It might be something to do with the plugin having to use Apple's antiquated Matplotlib library that we were forced to use under Python 2. I'll make a point of looking into whether that feature can be added (or added back in).

Q2: Yes, Custom Line Segments do exactly that. Only they don't seem to be doing exactly that at the moment. ;) I think you might've stumbled onto a bug introduced in the conversion to Python 3. I'll look into that as well.

We're hosting our family Christmas this weekend (with house guests) so it might be a couple of days before I can spend some serious time on this.

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

[My Plugins] - [My Forums]

Posted on
Fri Jan 20, 2023 9:13 am
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

No worries on taking your time - enjoy the family time!

Aldon

Posted on
Fri Jan 20, 2023 10:24 am
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

One other thing to maybe look at - the Theme Manager doesn't seem to be working right. I can't save a theme, I get this in the Indigo log when I select Save as an action:
Code: Select all
   Matplotlib Error                Error in plugin execution UiAction:

  File "plugin.py", line 4536, in themeExecuteActionButton
  File "plugin.py", line 4509, in themeApply
type: ('select',)

And it seems all changes are applied to some or all of the charts immediately without saving or applying.

Thanks,
Aldon

Posted on
Fri Jan 20, 2023 10:40 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Thanks for the head's up!

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

[My Plugins] - [My Forums]

Posted on
Mon Jan 23, 2023 2:15 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Hey Aldon, I'm working on sorting the Theme Manager first and think I have all the actions sorted.

Just so there's no misunderstanding:
  • Apply - this is to apply the selected theme to all your charts. It doesn't apply any changes you've made in the dialog box to the selected theme.
  • Delete - this is to delete the selected theme.
  • Rename - this is to rename the selected theme.
  • Save - this is to save the current settings under the name entered. This used to only work for new names; it will now work to save changes to an existing theme name.

And it seems all changes are applied to some or all of the charts immediately without saving or applying.

Please tell me more about this (I can't recreate it). Do you mean that when you change one of the settings, the change is applied to existing charts without saving the changed theme?

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

[My Plugins] - [My Forums]

Posted on
Mon Jan 23, 2023 3:01 pm
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

Hi Dave,
Thanks for the explanation - makes sense. Just so I understand, this means you can't have some of the charts with theme A and others with theme B? Not an issue, just wanted to make sure I didn't miss a subtlety.

Since I had no themes listed in the dialog, anything I changed got applied to newly rendered charts (I don't recall if I clicked Save or Apply for this to happen). I was never able to get a theme name added.

When I entered a theme name and clicked Save, it was when the error I listed above got thrown but it acted like the change to the (invisible) theme got applied.

Aldon

Posted on
Mon Jan 23, 2023 4:01 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Thanks, that's helpful.

Regarding how themes are applied, that's the intended behavior. That is, when you select a new theme, it'll be applied to all charts (that's why there's only a sub-set of attributes within each theme). So you might use theme 1 when it's daylight and theme 2 when it's night. This was done so that users could change the look of their charts based on automation. I think doing it with multiple active themes would be an order of magnitude more complicated. :)

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

[My Plugins] - [My Forums]

Posted on
Wed Jan 25, 2023 9:57 am
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

@Aldon - I've updated the Matplotlib plugin to address the issues identified above. Please let me know if you see anything that's still not quite right.

https://www.indigodomo.com/pluginstore/27/

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

[My Plugins] - [My Forums]

Posted on
Wed Jan 25, 2023 12:22 pm
aldonc offline
Posts: 45
Joined: Jan 10, 2015

Re: Recreating weather forecast charts

Hi Dave,
Themes seem to be working ok. I haven't tested extensively but I can now create and apply different themes.

The Custom Line Segments don't seem to be working for me though. I created a new device and put in a single data line then added this to the Constants field.
Code: Select all
(30,"blue")

and I don't see anything for that line in the plot. That number is within the range of what's displayed with the data I've chosen so it's not off the screen somewhere. BTW, I've tried 30, 32, 32.0 and different color names (but not hex) and none of that makes a difference.

thanks,
Aldon

Posted on
Wed Jan 25, 2023 12:34 pm
DaveL17 offline
User avatar
Posts: 6742
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: Recreating weather forecast charts

Hi Aldon - thanks. Please go to the plugin menu and select "Advanced Settings...".

Then check "Enable Custom Line Segments". If you want, you can also enable "Promote Custom Line Segments" to ensure that they always appear.

If that doesn't do the trick, we'll have to dig deeper.

chart_aldon.png
chart_aldon.png (15.54 KiB) Viewed 1306 times

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 2 guests

cron