Any kludge to plot a 3rd item with a different yscale?

61 views
Skip to first unread message

Alec Bennett

unread,
Apr 16, 2017, 8:33:58 PM4/16/17
to weewx-user
I need to plot wind speed, wind gust and barometric pressure on a single graph. The problem is that they have such different yscales that differences in barometric pressure aren't visible. 

For example, see the attached chart, which shows the wind ranging from about 5 to 15 mph, and the barometric pressure ranging from about 30.15 to 30.2 inHG. When those ranges are plotted together the barometeric pressure appears as a straight line.

I've been playing with editing genplot.py to produce a transparent plot of just the barometric pressure and then pasting it over a plot of the wind graph, but thinking there must be an easier way. I don't imagine anyone has any ideas? Ugly hacks are invited.

And note that I don't need to add any Y axis labels for the barometer, it's enough just to plot the line. And I don't need auto yscale ranging, I'll just set it to the min and max pressures on record for the area (28.8 and 30.6).




daywindbarometer-avg.png

Thomas Keffer

unread,
Apr 16, 2017, 10:05:33 PM4/16/17
to weewx-user
Sorry, but it is not possible.

It's been asked for many times, but would require a pretty substantial rewrite of weeplot, as well as some creative use of ConfigObj.

Your hack is actually not so crazy.

-tk

--
You received this message because you are subscribed to the Google Groups "weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to weewx-user+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Andrew Milner

unread,
Apr 17, 2017, 12:16:25 AM4/17/17
to weewx-user
Just out of curiosity - is there a specific reason for plotting windspeed/wind gust together with pressure?  Windspeed is a factor of pressure difference between two points rather than the varying pressure at a single point, and the pressure difference is often a result of temperature differentials.  Not sure I can see what benefit can be obtained from plotting windspeed against a single varying pressure without also having the other contributing pressure points simultaneously plotted.

Maybe I am just being my usual obnoxious pedantic self, and spouting drivel ...... but then again .... maybe not .....

Alec Bennett

unread,
Apr 17, 2017, 12:42:04 AM4/17/17
to weewx...@googlegroups.com
On Sun, Apr 16, 2017 at 7:05 PM, Thomas Keffer <tke...@gmail.com> wrote:
Sorry, but it is not possible.

It's been asked for many times, but would require a pretty substantial rewrite of weeplot, as well as some creative use of ConfigObj.

Your hack is actually not so crazy.

Well alright then, liberal amounts of duct tape have been applied! See attached.

Inline image 1

I still need to clean it up a bit and maybe not show gusts as well, and change the color scheme, but that's the work in progress. 

It's been asked for many times

In that case I'll mention that my method was to edit genplot.py and imagegenerator.py so if a filename has "-trans" in it, it builds just the plot line on a transparent background with no labels. And every time a regular graph is built it searches for a file with the same name but "-trans" appended to it, and if found pastes it over the current graph. So in the above example it built a transparent version of the barometer graph with no labels and then pasted it over the wind graph. It's a kludge but it works, and it required as little hard coding of parameters that I could think of.

Let me know if there's interest and I'll post this hack to my github page, but fair warning it's *very* hacky, and currently it doesn't have the ability to draw the Y axis labels for the 2nd item (in this case the barometer). And of course it's not a regular user extension so it'll get overwritten with any weewx updates.

Just out of curiosity - is there a specific reason for plotting windspeed/wind gust together with pressure?  

So we can see fronts moving through, which affect the wind speed, or so our theory goes. Together with the wind direction vector chart, which is shown right below this in  the iOS app I'm working on, people can get a good idea of weather changes with just two graphs. At least that's our theory. And a biggie for us is that we're duplicating some functionality from the Bodega Marine Lab near us (run by the University of California at Davis), which has this same chart. 

Inline image 2

But 




 

Alec Bennett

unread,
Apr 17, 2017, 12:52:57 AM4/17/17
to weewx...@googlegroups.com

Andrew Milner

unread,
Apr 17, 2017, 12:56:29 AM4/17/17
to weewx-user
Aha - I think I see ... the graph shows the layman's "calm before the storm" - after the storm has passed!!

But the wind alone shows that (from steady low to increasing) - as does the change in pressure alone (from falling to rising).  What would be interesting would be to know the locations of high and low pressure in relation to the measuring station location ....

Would be interesting to see what happened after 8pm - when pressure was still rising, but wind has started to fall ......

Guess I'll just put my head back in the sand where it belongs ....

Alec Bennett

unread,
Apr 17, 2017, 1:42:24 AM4/17/17
to weewx...@googlegroups.com


On Apr 16, 2017, at 9:56 PM, Andrew Milner <andrew.s...@gmail.com> wrote:

Aha - I think I see ... the graph shows the layman's "calm before the storm" - after the storm has passed!!

Right, it's not meant to be predictive. 


But the wind alone shows that (from steady low to increasing) - as does the change in pressure alone (from falling to rising). 

Sure, but it's interesting to see how the wind and pressure correlate. 


What would be interesting would be to know the locations of high and low pressure in relation to the measuring station location ....

Agreed that would indeed be interesting. 

Here's the live chart by the way:















Guess I'll just put my head back in the sand where it belongs ....



On Monday, 17 April 2017 07:42:04 UTC+3, Alec Bennett wrote:


On Sun, Apr 16, 2017 at 7:05 PM, Thomas Keffer <tke...@gmail.com> wrote:
Sorry, but it is not possible.

It's been asked for many times, but would require a pretty substantial rewrite of weeplot, as well as some creative use of ConfigObj.

Your hack is actually not so crazy.

Well alright then, liberal amounts of duct tape have been applied! See attached.

Inline image 1

I still need to clean it up a bit and maybe not show gusts as well, and change the color scheme, but that's the work in progress. 

It's been asked for many times

In that case I'll mention that my method was to edit genplot.py and imagegenerator.py so if a filename has "-trans" in it, it builds just the plot line on a transparent background with no labels. And every time a regular graph is built it searches for a file with the same name but "-trans" appended to it, and if found pastes it over the current graph. So in the above example it built a transparent version of the barometer graph with no labels and then pasted it over the wind graph. It's a kludge but it works, and it required as little hard coding of parameters that I could think of.

Let me know if there's interest and I'll post this hack to my github page, but fair warning it's *very* hacky, and currently it doesn't have the ability to draw the Y axis labels for the 2nd item (in this case the barometer). And of course it's not a regular user extension so it'll get overwritten with any weewx updates.

Just out of curiosity - is there a specific reason for plotting windspeed/wind gust together with pressure?  

So we can see fronts moving through, which affect the wind speed, or so our theory goes. Together with the wind direction vector chart, which is shown right below this in  the iOS app I'm working on, people can get a good idea of weather changes with just two graphs. At least that's our theory. And a biggie for us is that we're duplicating some functionality from the Bodega Marine Lab near us (run by the University of California at Davis), which has this same chart. 

Inline image 2

But 




 

--
You received this message because you are subscribed to a topic in the Google Groups "weewx-user" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/weewx-user/2FFE87-xqFU/unsubscribe.
To unsubscribe from this group and all its topics, send an email to weewx-user+...@googlegroups.com.

Glenn McKechnie

unread,
Apr 21, 2017, 5:06:16 AM4/21/17
to weewx...@googlegroups.com


On 17 April 2017 at 14:41, Alec Bennett <wryb...@gmail.com> wrote:

[...]
It's been asked for many times

In that case I'll mention that my method was to edit genplot.py and imagegenerator.py so if a filename has "-trans" in it, it builds just the plot line on a transparent background with no labels. And every time a regular graph is built it searches for a file with the same name but "-trans" appended to it, and if found pastes it over the current graph. So in the above example it built a transparent version of the barometer graph with no labels and then pasted it over the wind graph. It's a kludge but it works, and it required as little hard coding of parameters that I could think of.

Let me know if there's interest and I'll post this hack to my github page, but fair warning it's *very* hacky, and currently it doesn't have the ability to draw the Y axis labels for the 2nd item (in this case the barometer). And of course it's not a regular user extension so it'll get overwritten with any weewx updates.unctionality from the Bodega Marine Lab near us (run by the University of California at Davis), which has this same chart. 


Hmm,
I'm comparing 2 rain gauges which 'almost' tally, but not quite. I'm currently plotting actual bucket tips (the volume differs) against time in an attempt to visualize what's happening. They have differing starting counts so plotting them together with the same scale makes no sense, an overlay of one against the other, using no scale, could help though.
I'd appreciate seeing your rough notes, or kludged weewx files on https://github.com/wrybread.

Reply all
Reply to author
Forward
0 new messages