|
From: Christopher B. <Chr...@no...> - 2009-05-06 19:11:13
|
Hi folks, Has anyone used MPL to make stick plots? If so, can I borrow your code? http://tabs.gerg.tamu.edu/Tglo/RTA/N/Oceanographic_CurrentStick_30.html Thanks, -Chris -- Christopher Barker, Ph.D. Oceanographer NOAA/OR&R/HAZMAT (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception |
|
From: Eric F. <ef...@ha...> - 2009-05-06 20:10:22
|
Christopher Barker wrote: > Hi folks, > > Has anyone used MPL to make stick plots? If so, can I borrow your code? > > http://tabs.gerg.tamu.edu/Tglo/RTA/N/Oceanographic_CurrentStick_30.html > > Thanks, > > -Chris > > > Chris, This would be a good addition. It might be implemented nicely by subclassing LineCollection, adding a set_transforms method something like that in EllipseCollection. Eric |
|
From: Eric F. <ef...@ha...> - 2009-05-06 21:19:20
|
Christopher Barker wrote: > Hi folks, > > Has anyone used MPL to make stick plots? If so, can I borrow your code? > > http://tabs.gerg.tamu.edu/Tglo/RTA/N/Oceanographic_CurrentStick_30.html > > Thanks, > > -Chris > > > Chris, If no one volunteers anything, then I suggest using quiver(..., headlength=0, headwidth=0, headaxislength=0), together with quiverkey(...). This will effectively give you a stick plot, with lots of flexibility. It could be implemented more efficiently in any of several ways, but it would take work to do it well. Eric |
|
From: Christopher B. <Chr...@no...> - 2009-05-06 21:46:34
|
Eric Firing wrote:
> Christopher Barker wrote:
>> Has anyone used MPL to make stick plots? If so, can I borrow your code?
> If no one volunteers anything, then I suggest using quiver(...,
> headlength=0, headwidth=0, headaxislength=0), together with
> quiverkey(...). This will effectively give you a stick plot, with lots
> of flexibility.
Thanks, I was thinking that quiver() would get direction wrong, as the x
and y scales are in totally different units, but it looks like that's
not the case if you use the "angles" keyword:
angles: [‘uv’ | ‘xy’ | array]
With the default ‘uv’, the arrow aspect ratio is 1, so that if
U*==*V the angle of the arrow on the plot is 45 degrees CCW from the
x-axis. With ‘xy’, the arrow points from (x,y) to (x+u, y+v).
Alternatively, arbitrary angles may be specified as an array of values
in degrees, CCW from the x-axis.
> It could be implemented more efficiently in any of
> several ways, but it would take work to do it well.
I hope I'll get time to do that, but I don't really like quiver stick
plots anyway. I prefer plots (that I don't know the name of) that:
Time is on the x axis
Magnitude of the velocity is the x axis
At each data point, there is a dot, and the direction is given with a
unit-length arrow originating at that dot, in the direction of the
observation.
I wrote a version of this a while back with the old MPL transforms
mechanism, but haven't taken the time to translate it.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Gökhan S. <gok...@gm...> - 2009-05-06 23:52:56
|
Just for your information: Mayavi has a quiver3d function (http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#quiver3d) if you want to go a fancier way :) This said, I don't know how to hide arrow heads in Mayavi. Also what you showed in your original post seem a little like wind-barbs, well except without notches. Gökhan On Wed, May 6, 2009 at 4:46 PM, Christopher Barker <Chr...@no...> wrote: > Eric Firing wrote: >> Christopher Barker wrote: >>> Has anyone used MPL to make stick plots? If so, can I borrow your code? >> If no one volunteers anything, then I suggest using quiver(..., >> headlength=0, headwidth=0, headaxislength=0), together with >> quiverkey(...). This will effectively give you a stick plot, with lots >> of flexibility. > > Thanks, I was thinking that quiver() would get direction wrong, as the x > and y scales are in totally different units, but it looks like that's > not the case if you use the "angles" keyword: > > angles: [‘uv’ | ‘xy’ | array] > With the default ‘uv’, the arrow aspect ratio is 1, so that if > U*==*V the angle of the arrow on the plot is 45 degrees CCW from the > x-axis. With ‘xy’, the arrow points from (x,y) to (x+u, y+v). > Alternatively, arbitrary angles may be specified as an array of values > in degrees, CCW from the x-axis. > > > It could be implemented more efficiently in any of >> several ways, but it would take work to do it well. > > I hope I'll get time to do that, but I don't really like quiver stick > plots anyway. I prefer plots (that I don't know the name of) that: > > > Time is on the x axis > > Magnitude of the velocity is the x axis > > At each data point, there is a dot, and the direction is given with a > unit-length arrow originating at that dot, in the direction of the > observation. > > I wrote a version of this a while back with the old MPL transforms > mechanism, but haven't taken the time to translate it. > > -Chris > > > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Eric F. <ef...@ha...> - 2009-05-06 22:30:30
|
Christopher Barker wrote: > Eric Firing wrote: >> Christopher Barker wrote: >>> Has anyone used MPL to make stick plots? If so, can I borrow your code? >> If no one volunteers anything, then I suggest using quiver(..., >> headlength=0, headwidth=0, headaxislength=0), together with >> quiverkey(...). This will effectively give you a stick plot, with lots >> of flexibility. > > Thanks, I was thinking that quiver() would get direction wrong, as the x > and y scales are in totally different units, but it looks like that's > not the case if you use the "angles" keyword: > > angles: [‘uv’ | ‘xy’ | array] > With the default ‘uv’, the arrow aspect ratio is 1, so that if > U*==*V the angle of the arrow on the plot is 45 degrees CCW from the > x-axis. With ‘xy’, the arrow points from (x,y) to (x+u, y+v). > Alternatively, arbitrary angles may be specified as an array of values > in degrees, CCW from the x-axis. > > > It could be implemented more efficiently in any of >> several ways, but it would take work to do it well. > > I hope I'll get time to do that, but I don't really like quiver stick > plots anyway. I prefer plots (that I don't know the name of) that: > > > Time is on the x axis > > Magnitude of the velocity is the x axis > > At each data point, there is a dot, and the direction is given with a > unit-length arrow originating at that dot, in the direction of the > observation. I think this would be straightforward, using an ordinary plot command plus quiver. Eric > > I wrote a version of this a while back with the old MPL transforms > mechanism, but haven't taken the time to translate it. > > -Chris > > > > |
|
From: Christopher B. <Chr...@no...> - 2009-05-07 00:10:52
|
Gökhan SEVER wrote: > Mayavi has a quiver3d function > (http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#quiver3d) > if you want to go a fancier way :) which is cool, but I"m looking to plot a time series of a (2d) vector quantity at a single point. > Also what > you showed in your original post seem a little like wind-barbs, well > except without notches. yup -- stick plots are commonly used for wind data. -Chris > Gökhan > > > > On Wed, May 6, 2009 at 4:46 PM, Christopher Barker > <Chr...@no...> wrote: >> Eric Firing wrote: >>> Christopher Barker wrote: >>>> Has anyone used MPL to make stick plots? If so, can I borrow your code? >>> If no one volunteers anything, then I suggest using quiver(..., >>> headlength=0, headwidth=0, headaxislength=0), together with >>> quiverkey(...). This will effectively give you a stick plot, with lots >>> of flexibility. >> Thanks, I was thinking that quiver() would get direction wrong, as the x >> and y scales are in totally different units, but it looks like that's >> not the case if you use the "angles" keyword: >> >> angles: [‘uv’ | ‘xy’ | array] >> With the default ‘uv’, the arrow aspect ratio is 1, so that if >> U*==*V the angle of the arrow on the plot is 45 degrees CCW from the >> x-axis. With ‘xy’, the arrow points from (x,y) to (x+u, y+v). >> Alternatively, arbitrary angles may be specified as an array of values >> in degrees, CCW from the x-axis. >> >> > It could be implemented more efficiently in any of >>> several ways, but it would take work to do it well. >> I hope I'll get time to do that, but I don't really like quiver stick >> plots anyway. I prefer plots (that I don't know the name of) that: >> >> >> Time is on the x axis >> >> Magnitude of the velocity is the x axis >> >> At each data point, there is a dot, and the direction is given with a >> unit-length arrow originating at that dot, in the direction of the >> observation. >> >> I wrote a version of this a while back with the old MPL transforms >> mechanism, but haven't taken the time to translate it. >> >> -Chris >> >> >> >> >> -- >> Christopher Barker, Ph.D. >> Oceanographer >> >> Emergency Response Division >> NOAA/NOS/OR&R (206) 526-6959 voice >> 7600 Sand Point Way NE (206) 526-6329 fax >> Seattle, WA 98115 (206) 526-6317 main reception >> >> Chr...@no... >> >> >> ------------------------------------------------------------------------------ >> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your >> production scanning environment may not be a perfect world - but thanks to >> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 >> Series Scanner you'll get full speed at 300 dpi even with all image >> processing features enabled. http://p.sf.net/sfu/kodak-com >> _______________________________________________ >> Matplotlib-users mailing list >> Mat...@li... >> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >> -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |
|
From: Gökhan S. <gok...@gm...> - 2009-05-07 00:38:01
|
To me arrows are always useful to see the direction of wind easily. Since in meteorological convention barbs show where the wind is blowing from, but in pilot convention (I might have made up this one :)) in the opposite way. Gökhan On Wed, May 6, 2009 at 7:11 PM, Christopher Barker <Chr...@no...> wrote: > Gökhan SEVER wrote: >> Mayavi has a quiver3d function >> (http://code.enthought.com/projects/mayavi/docs/development/html/mayavi/auto/mlab_helper_functions.html#quiver3d) >> if you want to go a fancier way :) > > which is cool, but I"m looking to plot a time series of a (2d) vector > quantity at a single point. > >> Also what >> you showed in your original post seem a little like wind-barbs, well >> except without notches. > > yup -- stick plots are commonly used for wind data. > > -Chris > > >> Gökhan >> >> >> >> On Wed, May 6, 2009 at 4:46 PM, Christopher Barker >> <Chr...@no...> wrote: >>> Eric Firing wrote: >>>> Christopher Barker wrote: >>>>> Has anyone used MPL to make stick plots? If so, can I borrow your code? >>>> If no one volunteers anything, then I suggest using quiver(..., >>>> headlength=0, headwidth=0, headaxislength=0), together with >>>> quiverkey(...). This will effectively give you a stick plot, with lots >>>> of flexibility. >>> Thanks, I was thinking that quiver() would get direction wrong, as the x >>> and y scales are in totally different units, but it looks like that's >>> not the case if you use the "angles" keyword: >>> >>> angles: [‘uv’ | ‘xy’ | array] >>> With the default ‘uv’, the arrow aspect ratio is 1, so that if >>> U*==*V the angle of the arrow on the plot is 45 degrees CCW from the >>> x-axis. With ‘xy’, the arrow points from (x,y) to (x+u, y+v). >>> Alternatively, arbitrary angles may be specified as an array of values >>> in degrees, CCW from the x-axis. >>> >>> > It could be implemented more efficiently in any of >>>> several ways, but it would take work to do it well. >>> I hope I'll get time to do that, but I don't really like quiver stick >>> plots anyway. I prefer plots (that I don't know the name of) that: >>> >>> >>> Time is on the x axis >>> >>> Magnitude of the velocity is the x axis >>> >>> At each data point, there is a dot, and the direction is given with a >>> unit-length arrow originating at that dot, in the direction of the >>> observation. >>> >>> I wrote a version of this a while back with the old MPL transforms >>> mechanism, but haven't taken the time to translate it. >>> >>> -Chris >>> >>> >>> >>> >>> -- >>> Christopher Barker, Ph.D. >>> Oceanographer >>> >>> Emergency Response Division >>> NOAA/NOS/OR&R (206) 526-6959 voice >>> 7600 Sand Point Way NE (206) 526-6329 fax >>> Seattle, WA 98115 (206) 526-6317 main reception >>> >>> Chr...@no... >>> >>> >>> ------------------------------------------------------------------------------ >>> The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your >>> production scanning environment may not be a perfect world - but thanks to >>> Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 >>> Series Scanner you'll get full speed at 300 dpi even with all image >>> processing features enabled. http://p.sf.net/sfu/kodak-com >>> _______________________________________________ >>> Matplotlib-users mailing list >>> Mat...@li... >>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users >>> > > > -- > Christopher Barker, Ph.D. > Oceanographer > > Emergency Response Division > NOAA/NOS/OR&R (206) 526-6959 voice > 7600 Sand Point Way NE (206) 526-6329 fax > Seattle, WA 98115 (206) 526-6317 main reception > > Chr...@no... > > > ------------------------------------------------------------------------------ > The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your > production scanning environment may not be a perfect world - but thanks to > Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700 > Series Scanner you'll get full speed at 300 dpi even with all image > processing features enabled. http://p.sf.net/sfu/kodak-com > _______________________________________________ > Matplotlib-users mailing list > Mat...@li... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > |
|
From: Christopher B. <Chr...@no...> - 2009-05-14 00:09:54
Attachments:
StickPlot.py
|
Eric Firing wrote: > Christopher Barker wrote: >> Has anyone used MPL to make stick plots? If so, can I borrow your code? > If no one volunteers anything, then I suggest using quiver(..., > headlength=0, headwidth=0, headaxislength=0), together with > quiverkey(...). This will effectively give you a stick plot, with lots > of flexibility. I've got a start enclosed. I'm having trouble with a few issues: 1) I'd like to be able to pass in datetime objects for the x axis, but that doesn't seem to be supported -- is that a bug? (uncomment the datetime list comp to see the error) 2) I'm a little confused about what to put on the y axis -- stick plots often use the y axis to provide a scale for the velocites, but I can't figure out what units I'd use there -- quiver is scaling the "arrows", so I don't know what units they are in. 3) it seemed like I should be able to use angles=array to pass in the angles directly, but that didn't work for me. > It could be implemented more efficiently in any of > several ways, but it would take work to do it well. yup -- and the whole LineCollection/transforms thing confuses me anyway... Any suggestions to improve this? -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/OR&R (206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception Chr...@no... |