Plotting wind vectors (wind speed and direction)

1,050 views
Skip to first unread message

Carwyn Pelley

unread,
Aug 27, 2013, 4:48:47 AM8/27/13
to

A number of users have asked for guidance on plotting wind vectors , so I thought I would create a github gist and post a link here:
https://gist.github.com/cpelley/6351152

Please note that I used randomly generated data in order to share publicly.

This would obviously be applicable to plotting any similar vectors such as ocean currents perhaps...

Phil Elson

unread,
Aug 28, 2013, 11:20:40 AM8/28/13
to Carwyn Pelley, scitoo...@googlegroups.com
It'd be cool if you could share this as a notebook so we can all see the pictures without necessarily running the code... ;-)


On 27 August 2013 09:48, Carwyn Pelley <cpell...@gmail.com> wrote:

A number of users have asked for guidance on plotting wind vectors , so I thought I would create a github gist and post a link here:
https://gist.github.com/cpelley/6351152

Please note that I used randomly generated the data in order to share publicly.

This would obviously be applicable to plotting any similar vectors such as ocean currents perhaps...

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

Rich Signell

unread,
Aug 28, 2013, 12:08:09 PM8/28/13
to Phil Elson, Carwyn Pelley, scitoo...@googlegroups.com
but I agree that it would be cool if authors of examples could share notebooks so that when they make changes the nbviewer rendering would automagically get updated also.
--
Dr. Richard P. Signell   (508) 457-2229
USGS, 384 Woods Hole Rd.  
Woods Hole, MA 02543-1598

Rich Signell

unread,
Aug 28, 2013, 12:09:43 PM8/28/13
to Phil Elson, Carwyn Pelley, scitoo...@googlegroups.com
This example also exposes the clipping bug that I guess still exists in Cartopy (the xaxis and yaxis labels are nearly completely clipped in my notebook example)

Phil Elson

unread,
Aug 29, 2013, 3:00:12 AM8/29/13
to Rich Signell, Phil Elson, Carwyn Pelley, scitoo...@googlegroups.com
Rich, what version of matplotlib are you using? I think I've fixed this for v1.3.

Carwyn Pelley

unread,
Aug 29, 2013, 5:38:24 AM8/29/13
to scitoo...@googlegroups.com, Rich Signell, Phil Elson, Carwyn Pelley
Thanks Rich, a lot more presentable in your ipython notebook!

Rich Signell

unread,
Aug 29, 2013, 7:07:28 AM8/29/13
to Phil Elson, Carwyn Pelley, scitoo...@googlegroups.com
Phil,

Yes, after upgrading to Matplotlib v1.3, the clipping problem is gone:
http://nbviewer.ipython.org/urls/raw.github.com/rsignell-usgs/ipython-notebooks/master/Iris_Vector_Plot.ipynb

It's so awesome that you fixed this Matplotlib v1.2 bug, fixing the problem not only for Iris and Cartopy users, but for the entire Python community. 

This is a great aspect about the Iris project -- and one which I'm trying to promote here in US Government work, using Iris as an example!

Thanks,
Rich

Carwyn Pelley

unread,
Sep 19, 2013, 6:07:53 AM9/19/13
to scitoo...@googlegroups.com, Phil Elson, Carwyn Pelley, rsig...@usgs.gov
I thought I should point out for those looking at the above example, that Andrew Dawson has made a fantastic enhancement in cartopy so that vectors can now be plotted to any specified projection! not just orthogonal ones.
https://github.com/SciTools/cartopy/pull/348

I'll update the example above when I have time.
Reply all
Reply to author
Forward
0 new messages