Re: [Matplotlib-users] windrose 0.3
Lionel Roubeyrie <[EMAIL PROTECTED]> writes: > > Hi all, > continuing on the windroses, here the third version of windrose.py, with two > others styles (line and bar2 (is it what you want Derek?)). I want to know > how it's possible to modify the legends to be on axes, and not on the figure > like in the ex4.png subplots example. Lionel Looks great! Is it possible to change the size/position of the legend - the fonts certainly seem too big, and the whole box overlaps the figure. Derek - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] windrose 0.3
Le vendredi 13 octobre 2006 08:26, Derek a écrit : > Lionel Roubeyrie <[EMAIL PROTECTED]> writes: > > Hi all, > > continuing on the windroses, here the third version of windrose.py, with > > two others styles (line and bar2 (is it what you want Derek?)). I want to > > know how it's possible to modify the legends to be on axes, and not on > > the figure like in the ex4.png subplots example. > > Lionel > > Looks great! Is it possible to change the size/position of the legend - > the fonts certainly seem too big, and the whole box overlaps the figure. > > Derek Hi Derek, yes it's possible, with: freq,ax=windrose.windplot(vent['VV'],vent['DV'],counts=False,speed_classes=[1,2,3,4,5],sectors=16,style='bar') draw() fig=ax.get_figure() for leg in fig.legends: setp(leg.get_texts(), fontsize=8) > > > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job > easier Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users -- Lionel Roubeyrie - [EMAIL PROTECTED] LIMAIR http://www.limair.asso.fr - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Got to set WXAgg on Mac to get pylab to work?
Edit your "~/.matplotlib/matplotlibrc" file to specify the default.
On OSX WXAgg or TkAgg is the best bet.
On 10/12/06, Louis Pecora <[EMAIL PROTECTED]> wrote:
>
> In order get pylab to work on my Mac I have to do the following (found
> by some experimenting):
>
> import matplotlib
> matplotlib.use("WXAgg")
> import pylab
>
> Does this seem right? I mean, it works, but it seems to be a little
> gymnastics to go through rather than just doing
>
> import pylab
>
> which gives
>
> ImportError: No module named gobject
>
> since it can't seem to find that backend in the "backend" directory when
> it tries to import backend_gtkagg.py. I guess that doesn't work on the
> Mac.
>
>
> My setup: (Tiger 10.4) Al Laptop, Python 2.4, latest pylab from SciPy
> package.
>
> --
> Cheers,
>
> Lou Pecora
>
> Code 6362
> Naval Research Lab
> Washington, DC 20375
> USA
> Ph: +202-767-6002
> email: [EMAIL PROTECTED]
>
>
> -
> Using Tomcat but need to do more? Need to support web services, security?
> Get stuff done quickly with pre-integrated technology to make your job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
> http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
-
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] plot x y value(x,y)
Hi, this is probably a stupid question, but somehow I just can't figure out how to do it. I have data given in an array with entries: x y data(x,y) and thus of shape (#data points, 3) what is the easiest way with mpl to plot these data points, susch that they are located at x,y and colored according to data(xy)? Thanks for any pointers, Hanno -- Hanno Klemm [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Hi, No stupid question at all! I don't really understand your question, but it sounds to me like a scatter plot is what you want. In that case, just have a look at the scatter plot demos on the web page (-> screenshots) or in the example files. HTH Christian On Friday 13 October 2006 14:25, Hanno Klemm wrote: > Hi, > > this is probably a stupid question, but somehow I just can't figure > out how to do it. I have data given in an array with entries: > > x y data(x,y) > > and thus of shape (#data points, 3) > > what is the easiest way with mpl to plot these data points, susch that > they are located at x,y and colored according to data(xy)? > > Thanks for any pointers, > Hanno - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Christian Meesters wrote: > Hi, > > No stupid question at all! I don't really understand your question, but it > sounds to me like a scatter plot is what you want. In that case, just have a > look at the scatter plot demos on the web page (-> screenshots) or in the > example files. > > HTH > Christian > > Actually sounds more like a surface or contour plot. You have x, y, and z where z=function of (x,y). I thought there was a contour call in matplotlib. I'll look. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Hi Louis, sorry for being unclear. What I have is a list of data points given in the format x y value so my array looks like x_1, y_1, v_1 x_2, y_2, v_2, etc. Now I want to plot a point at (x_i, y_i) and assign to it a color according to v_i. The problem is, that the values at x and y are given and are not calculated. Christian's suggestion with a scatter plot works fine for me, but if there are other possibilities I'm always keen to learn something. Hope this clarifies matters. Best regards, Hanno Louis Pecora <[EMAIL PROTECTED]> said: > Christian Meesters wrote: > > Hi, > > > > No stupid question at all! I don't really understand your question, but it > > sounds to me like a scatter plot is what you want. In that case, just have a > > look at the scatter plot demos on the web page (-> screenshots) or in the > > example files. > > > > HTH > > Christian > > > > > > Actually sounds more like a surface or contour plot. You have x, y, and > z where z=function of (x,y). I thought there was a contour call in > matplotlib. I'll look. > > -- > Cheers, > > Lou Pecora > > Code 6362 > Naval Research Lab > Washington, DC 20375 > USA > Ph: +202-767-6002 > email: [EMAIL PROTECTED] > > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Hanno Klemm [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
I think Louis' idea of using contour plots for your problem is not that bad. It depends, of course, on the actual meaning of your data ... Assume you understand German? Have a look here: http://www.python-forum.de/topic-5294.html Christian On Friday 13 October 2006 15:19, Hanno Klemm wrote: > Hi Louis, > > sorry for being unclear. What I have is a list of data points given in > the format > > x y value > > so my array looks like > > x_1, y_1, v_1 > x_2, y_2, v_2, > > etc. > > Now I want to plot a point at (x_i, y_i) and assign to it a color > according to v_i. The problem is, that the values at x and y are given > and are not calculated. > > Christian's suggestion with a scatter plot works fine for me, but if > there are other possibilities I'm always keen to learn something. > > Hope this clarifies matters. > > Best regards, > Hanno > > Louis Pecora <[EMAIL PROTECTED]> said: > > Christian Meesters wrote: > > > Hi, > > > > > > No stupid question at all! I don't really understand your > > question, but it > > > > sounds to me like a scatter plot is what you want. In that case, > > just have a > > > > look at the scatter plot demos on the web page (-> screenshots) or > > in the > > > > example files. > > > > > > HTH > > > Christian > > > > Actually sounds more like a surface or contour plot. You have x, y, > > and > > > z where z=function of (x,y). I thought there was a contour call in > > matplotlib. I'll look. > > > > -- > > Cheers, > > > > Lou Pecora > > > > Code 6362 > > Naval Research Lab > > Washington, DC 20375 > > USA > > Ph: +202-767-6002 > > email: [EMAIL PROTECTED] > > - > > > Using Tomcat but need to do more? Need to support web services, > > security? > > > Get stuff done quickly with pre-integrated technology to make your > > job easier > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > Geronimo > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > ___ > > Matplotlib-users mailing list > > [email protected] > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Merging subplots (Was: Re: subplot(1, 1, [...]) and pprint_getters)
Hi, > Stefan> Now on to my real question. Say I have a screen of 4x4 > Stefan> subplots, created with subplot(221). I'd like to be able > Stefan> to split the screen as such: __ __ > Stefan> | | | > Stefan> | | | > Stefan> |--| | > Stefan> | | | > Stefan> |__|__| > > ax1 = subplot(221) > ax2 = subplot(223) > ax3 = subplot(122) OK, that one was kind of easy, but more generally, is there a simple solution to 'merge' some axes (beside doing it manually), like subplot(1,3,[1,2]) for: +---+-+ | | | +---+-+ or any more complex layout? (maybe someone remember there was such a functionnality under SuperMongo! see http://www.astro.princeton.edu/~rhl/sm/sm.html#SYN83) Cheers. -- / \ ,, _._ _ |oo| _ / \__/ \ _ ((/ () \)) / \ Yannick COPIN (o:>* Doctus cum libro |/| ( )|oo| Institut de physique nucleaire de Lyon \/ _`\ /'_/ \(IN2P3 - France) / /.-' /\<>/\ `\.( () )_._ Tel: (33/0) 472 431 968 |` / \/ \ /`'--') http://snovae.in2p3.fr/ycopin/ \__,-'`| |. |\/ |/\/\|"\"` AIM: YcCopinICQ: 236931013 jgs | |. | \___/\___/ | |. | || - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Hanno Klemm wrote: > Hi Louis, > > sorry for being unclear. What I have is a list of data points given in > the format > > x y value > > so my array looks like > > x_1, y_1, v_1 > x_2, y_2, v_2, > > etc. > > Now I want to plot a point at (x_i, y_i) and assign to it a color > according to v_i. The problem is, that the values at x and y are given > and are not calculated. > > Christian's suggestion with a scatter plot works fine for me, but if > there are other possibilities I'm always keen to learn something. > > Hope this clarifies matters. > > Best regards, > Hanno > > Got it. Yes, sounds like you want a "3D" scatter plot. v (at some "height) over the surface of x,y points. There is a contour in matplotlib, but I don't think it will do what you want. I will go back and look over matplotlib. You might want to go to the matplotlib web site and download the examples. There are tons of them. Maybe one is right for you. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Yes, actually that's even better for what I want. However, after manipulating the Z values into a 2d array, I can then just as well use imshow to view their values. So I'll stick to the scatter plot approach for unevenly spaced data and to the contour/imshow approach for evenly gridded data. Thanks again, Hanno Christian Meesters <[EMAIL PROTECTED]> said: > I think Louis' idea of using contour plots for your problem is not that bad. > It depends, of course, on the actual meaning of your data ... > > Assume you understand German? Have a look here: > http://www.python-forum.de/topic-5294.html > > Christian > > On Friday 13 October 2006 15:19, Hanno Klemm wrote: > > Hi Louis, > > > > sorry for being unclear. What I have is a list of data points given in > > the format > > > > x y value > > > > so my array looks like > > > > x_1, y_1, v_1 > > x_2, y_2, v_2, > > > > etc. > > > > Now I want to plot a point at (x_i, y_i) and assign to it a color > > according to v_i. The problem is, that the values at x and y are given > > and are not calculated. > > > > Christian's suggestion with a scatter plot works fine for me, but if > > there are other possibilities I'm always keen to learn something. > > > > Hope this clarifies matters. > > > > Best regards, > > Hanno > > > > Louis Pecora <[EMAIL PROTECTED]> said: > > > Christian Meesters wrote: > > > > Hi, > > > > > > > > No stupid question at all! I don't really understand your > > > > question, but it > > > > > > sounds to me like a scatter plot is what you want. In that case, > > > > just have a > > > > > > look at the scatter plot demos on the web page (-> screenshots) or > > > > in the > > > > > > example files. > > > > > > > > HTH > > > > Christian > > > > > > Actually sounds more like a surface or contour plot. You have x, y, > > > > and > > > > > z where z=function of (x,y). I thought there was a contour call in > > > matplotlib. I'll look. > > > > > > -- > > > Cheers, > > > > > > Lou Pecora > > > > > > Code 6362 > > > Naval Research Lab > > > Washington, DC 20375 > > > USA > > > Ph: +202-767-6002 > > > email: [EMAIL PROTECTED] > > > > - > > > > > Using Tomcat but need to do more? Need to support web services, > > > > security? > > > > > Get stuff done quickly with pre-integrated technology to make your > > > > job easier > > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache > > > > Geronimo > > > > > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > > > ___ > > > Matplotlib-users mailing list > > > [email protected] > > > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > > - > Using Tomcat but need to do more? Need to support web services, security? > Get stuff done quickly with pre-integrated technology to make your job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 > ___ > Matplotlib-users mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > -- Hanno Klemm [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Figimage demo
Hi, I've been playing with the matplotlib demos (very impressive btw.) and I've found that figimage_demo.py and pcolor_nonuniform.py give exceptions on my computer. Here's the last part of the backtrace for pcolor_nonuniform.py: Traceback (most recent call last): File "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 284, in expose_event self._render_figure(self._pixmap, w, h) File "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", line 73, in _render_figure FigureCanvasAgg.draw(self) File "/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 392, in draw self.figure.draw(renderer) File "/usr/lib64/python2.4/site-packages/matplotlib/figure.py", line 545, in draw for a in self.axes: a.draw(renderer) File "/usr/lib64/python2.4/site-packages/matplotlib/axes.py", line 1067, in draw a.draw(renderer) File "/usr/lib64/python2.4/site-packages/matplotlib/image.py", line 189, in draw im = self.make_image(renderer.get_image_magnification()) TypeError: make_image() takes exactly 1 argument (2 given) Looking at the FigureImage class in image.py, make_image doesn't seem to have any clue about the magnification parameter. This call is in figure.py, and not the demo code, so it would appear to be a bug in the library. Any idea what's wrong? Thanks, Ryan -- Ryan May Graduate Research Assistant School of Meteorology University of Oklahoma [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Figimage demo
> "Ryan" == Ryan May <[EMAIL PROTECTED]> writes: Ryan> Looking at the FigureImage class in image.py, make_image Ryan> doesn't seem to have any clue about the magnification Ryan> parameter. This call is in figure.py, and not the demo Ryan> code, so it would appear to be a bug in the library. Any Ryan> idea what's wrong? Should be fixed in svn. JDH - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] 3D Parametric plots? (was: plot x y value(x, y) )
Hanno Klemm wrote: > Louis, > > my problem has been solved with your hint to contour and contourf. > > Thanks again, > Hanno > > > > Glad that helped although I wasn't sure. Your post did make me realize that a 3D scatter plot with option to connect points is a good idea. In my quick glance at the examples, I didn't see it, but I often have data that I want to plot as 3D points or line segments, i.e. as parametric plots, e.g. x,y,z positions of an object as a function of time. I'll have to look over matplotlib to see if this is doable. It would be nice. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: [EMAIL PROTECTED] - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 ___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] plot x y value(x,y)
Hanno, I wrestled with this one for a while. The attached script is the result of my effort. The two keys were to define the colormap, and then make sure that when you call the colormap that the values span the full range. For example, if you want a data point to be "yellow", and that color (RGB: 1,1,0) is between 0.75 and 0.85 on your colormap, then give the point a value of 0.81 (or whatever in the range). Then be sure to also pass a zero (0.0) and a one (1.0) to the scatter. By spanning the full scale range you will be sure to fix the color that you want from the colormap to the data point that you define. It might be a hack, but it works ok. Cheers, Jake -Original Message- From: Louis Pecora [mailto:[EMAIL PROTECTED] Sent: Friday, October 13, 2006 7:47 AM To: [email protected] Subject: Re: [Matplotlib-users] plot x y value(x,y) Hanno Klemm wrote: > Hi Louis, > > sorry for being unclear. What I have is a list of data points given in > the format > > x y value > > so my array looks like > > x_1, y_1, v_1 > x_2, y_2, v_2, > > etc. > > Now I want to plot a point at (x_i, y_i) and assign to it a color > according to v_i. The problem is, that the values at x and y are given > and are not calculated. > > Christian's suggestion with a scatter plot works fine for me, but if > there are other possibilities I'm always keen to learn something. > > Hope this clarifies matters. > > Best regards, > Hanno > > Got it. Yes, sounds like you want a "3D" scatter plot. v (at some "height) over the surface of x,y points. There is a contour in matplotlib, but I don't think it will do what you want. I will go back and look over matplotlib. You might want to go to the matplotlib web site and download the examples. There are tons of them. Maybe one is right for you. -- Cheers, Lou Pecora Code 6362 Naval Research Lab Washington, DC 20375 USA Ph: +202-767-6002 email: [EMAIL PROTECTED] fixed_color_scatter.py Description: fixed_color_scatter.py fixed_color_scatter.png Description: fixed_color_scatter.png - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Changing double circular helix
Hi Everyone! I have now been able to use Matplotlib on Window XP platfrom! Thanks for thiose who helped me to get Enthought Edition installed and working! I have no idea how to do what I have wanted to do for several years. I will try to describe the plot I need. I need to be able to include this plot in a Wikki. A point on a small circle with radius r0, is spiralling around (orthogonally) in a larger circle of radius r1, with these two radii related by r0/r1 = alpha. The smaller circle sweeps around the r1 radius to create a path, with the point (on r1) locus describing a torroid coil in the surface of the ring torus. This describes the plot when the torus is at-rest, but when the ring torus is in linear motion, both r0 and r1 change dimensions together, (keeping the same r0/r1 = alpha ratio), to create an increasing or decreasing spiralling circular helix, that is a fuction of the mass energy created by this motion. The point on the r0 circle is "like a snake chasing its tail?" When the torus is at-rest, the toroid path is closed, but in-motion, the torroid is open and becomes an increasing or decreasing spiral. This path will collapse back to a larger size if the energy is decreasing, and shrink to a smaller size if the energy is increasing. If the at-rest motion plot can be created ( I know that I can't do this plot by myself), then an animation of the ring torus figure moving through space to create a spiral would help in visualizing this figure. If this animation can slow down or speed up this would be great.. Can anyone help me to create this plot? Thanks for any help! Hubert fitch - Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642___ Matplotlib-users mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/matplotlib-users
Re: [Matplotlib-users] Changing double circular helix
On Fri, 2006-10-13 at 13:59 -0400, Hubert Fitch wrote:
> Hi Everyone!
>
> I have now been able to use Matplotlib on Window XP platfrom! Thanks
> for thiose who helped me to get Enthought Edition installed and
> working!
>
> I have no idea how to do what I have wanted to do for several years. I
> will try to describe the plot I need.
> I need to be able to include this plot in a Wikki.
>
> A point on a small circle with radius r0, is spiralling around
> (orthogonally) in a larger circle of radius r1, with these two radii
> related by r0/r1 = alpha. The smaller circle sweeps around the r1
> radius to create a path, with the point (on r1) locus describing a
> torroid coil in the surface of the ring torus.
>
> This describes the plot when the torus is at-rest, but when the ring
> torus is in linear motion, both r0 and r1 change dimensions together,
> (keeping the same r0/r1 = alpha ratio), to create an increasing or
> decreasing spiralling circular helix, that is a fuction of the mass
> energy created by this motion. The point on the r0 circle is "like a
> snake chasing its tail?"
>
> When the torus is at-rest, the toroid path is closed, but in-motion,
> the torroid is open and becomes an increasing or decreasing spiral.
> This path will collapse back to a larger size if the energy is
> decreasing, and shrink to a smaller size if the energy is increasing.
>
> If the at-rest motion plot can be created ( I know that I can't do
> this plot by myself), then an animation of the ring torus figure
> moving through space to create a spiral would help in visualizing this
> figure. If this animation can slow down or speed up this would be
> great..
Hmmm interesting
It's hard to follow your text description, but I think what you're
describing is at least a 3D visualisation, so matplotlib isn't ideal for
the task. Can you put this into equations? I'm not clear if your at-rest
plot should be a "trajectory" for a point moving round the torus
If you're willing to learn a new toolkit, this is a good task for VTK
(www.vtk.org). It's included in the enthought python distribution. The
problem here is that you almost certainly need to buy the user-guide
and/or the VTK text book to learn how to use it. VTK is very powerful,
but rather complex to learn.
Maybe this is a good task for VPython (http://www.vpython.org/ ). I've
never used this myself, but if looks well suited to this kind of dynamic
visualisation and is less intimidating than VTK (although it's built on
VTK I think).
Well below is a script to render a "coil" in 3D. It's too much work for
me to figure out the vector/matrix algebra to calculate the trajectory
you describe, but hopefully you get the idea: replace my 'trajectory'
function with whatever is appropriate for what you want. Maybe this will
get you started.
HTH
Bryan
---
"""
Draws a coil in 3D.
Mouse click to rotate the view.
Hit 'u' to start the animation (kill the program to stop it!)
"""
import vtk
import math
import time
offset = 0.0 #I'm going to use this to 'animate' the figure
def trajectory(t):
"""
returns 3D positions, as a function of one parameter, t
"""
global offset
r1 = 1.0
r0 = 0.2
omega=5.0
z = r1*math.sin(omega*t+offset)
y = r1*math.cos(omega*t+offset)
x = 0.5*t
return (x,y,z)
s = vtk.vtkProgrammableSource()
def Execute():
"""The Execute method to be called by the source object"""
#make a range of parameter values
tVals = numpy.arange(0,2*math.pi,0.05)
#convert these to positions
positions = [trajectory(t) for t in tVals]
#construct a VTK polydata object: a single poly-line 'cell'
dataset = s.GetPolyDataOutput()
points = vtk.vtkPoints()
cells = vtk.vtkCellArray()
cells.InsertNextCell(len(positions))
for p in positions:
id = points.InsertNextPoint(*p)
cells.InsertCellPoint(id)
dataset.SetPoints(points)
dataset.SetLines(cells)
return dataset
s.SetExecuteMethod(Execute)
#convert (poly)lines to a tube
t = vtk.vtkTubeFilter()
t.SetInput(s.GetOutput())
t.SetRadius(0.05)
t.SetNumberOfSides(10)
#make surface normals, so it renders smooth
n = vtk.vtkPolyDataNormals()
n.SetInput(t.GetOutput())
#boiler-plate VTK stuff
m=vtk.vtkPolyDataMapper()
m.SetInput(n.GetOutput())
a=vtk.vtkActor()
a.SetMapper(m)
ren = vtk.vtkRenderer()
ren.AddActor(a)
renwin = vtk.vtkRenderWindow()
renwin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renwin)
#add a simple animation routine, activated by the 'u' keypress
def Animate(obj, evt):
global offset
while 1: #need to kill the program to quit
offset += 0.1
s.Modified()
renwin.Render()
time.sleep(0.05)
iren.AddObserver("UserEvent", Animate)
iren.Initialize()
iren.Start()
>
> Can anyone help me to create this plot?
>
> Thanks for any help!
>
> Hubert fitch
>
>
> -
