## matplotlib-users

 [Matplotlib-users] plot three varaibles using matplotlib From: yadin Bocuma Rivas - 2007-10-11 17:49:11 Attachments: Message as HTML ```=0AI i have tree lists or array of values=0Alist x of 100... values=0Alist = y of 100.. values=0Alist mag of 100.. values=0Alist x and y are coordiantes= of points =0Aand list Mag is magnitude of something at that point=0A=0Ahow= can i plot this quantities using matplotlib, any function please?=0A=0Amy = code starts as.....i need to plot the points vhat can i use?=0A=0Afrom __fu= ture__ import division=0Afrom matplotlib.patches import Patch=0Afrom pylab = import *=0A=0Adef func3(x,y):=0A return (1- x/2 + x**5 + y**3)*exp(-x**2= -y**2)=0A=0A=0A# make these smaller to increase the resolution=0Adx, dy =3D= 0.5, 0.5=0A=0AX =3D arange(-3.0, 3.0001, dx)=0A=0AY =3D arange(-3.0, 3.000= 1, dy)=0A=0AMag=3D X**2+Y**2=0A=0A?????(X, Y, Mag)=0Acolorbar()=0Aaxis([-3,= 3,-3,3])=0Asavefig('three d plot of points making a surface')=0Ashow()=0A= =0A=0A=0A=0A=0A=0A =0A=A1S=E9 un mejor ambientalista!=0AEncuentra cons= ejos para cuidar el lugar donde vivimos en:=0A=0Ahttp://telemundo.yahoo.com= /promos/mejorambientalista.html=0A=0A=0A=0A=0A=0A ____________________= ________________________________________________________________=0A=A1S=E9 = un mejor fot=F3grafo!=0APerfecciona tu t=E9cnica y encuentra las mejores fo= tos. =0Ahttp://telemundo.yahoo.com/promos/mejorfotogr= afo.html```
 Re: [Matplotlib-users] plot three varaibles using matplotlib From: - 2007-10-11 19:10:14 Attachments: Message as HTML ```Hi Yadin, I am a simple user, but I already faced this problem. The idea I used is to plot the data as an image, with magnitudes being converted in color levels. To do that, you have to define an array (let's say 'Z', Z(x,y) with dims len(X) and len(Y) and fill it with tour magnitudes. Then you have a two dimensional array that you display as an image using : im = pylab.Imshow(Z) Imshow has a lot of options you can use to customize your display, and you can add a colorbar with : pylab.colorbar() I have some examples of such scripts, but commented in French, so perhaps not very useful for you. See the user's guide to begin, p 38 for example. Regards, Alain yadin Bocuma Rivas a écrit : > > I i have tree lists or array of values > list x of 100... values > list y of 100.. values > list mag of 100.. values > list x and y are coordiantes of points > and list Mag is magnitude of something at that point > > how can i plot this quantities using matplotlib, any function please? > > my code starts as.....i need to plot the points vhat can i use? > > from __future__ import division > from matplotlib.patches import Patch > from pylab import * > > def func3(x,y): > return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2) > > > # make these smaller to increase the resolution > dx, dy = 0.5, 0.5 > > X = arange(-3.0, 3.0001, dx) > > Y = arange(-3.0, 3.0001, dy) > > Mag= X**2+Y**2 > > ?????(X, Y, Mag) > colorbar() > axis([-3,3,-3,3]) > savefig('three d plot of points making a surface') > show() > > > ------------------------------------------------------------------------ > > ¡Sé un mejor ambientalista! > Encuentra consejos para cuidar el lugar donde vivimos en: > http://telemundo.yahoo.com/promos/mejorambientalista.html > > > ------------------------------------------------------------------------ > > ¡Sé un mejor besador! > Comparte todo lo que sabes sobre besos en: > http://telemundo.yahoo.com/promos/mejorbesador.html > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Splunk Inc. > Still grepping through log files to find problems? Stop. > Now Search log events and configuration files using AJAX and a browser. > Download your FREE copy of Splunk now >> http://get.splunk.com/ > ------------------------------------------------------------------------ > > _______________________________________________ > Matplotlib-users mailing list > Matplotlib-users@... > https://lists.sourceforge.net/lists/listinfo/matplotlib-users > ```