[Matplotlib-users] plot three varaibles using matplotlib
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 fotógrafo! Perfecciona tu técnica y encuentra las mejores fotos. http://telemundo.yahoo.com/promos/mejorfotografo.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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] pcolor or contour
hi i have been trying to use pcolor and/or contour to make a contor map or intensity map i want to do an intensity or contour map of an electric field i have an array (or list) of points [x,y] and for each point i have the respective value of the electric field (in another list) i have tried the examples in matplotlib but they are different because they use meshgrid and from the points calculated in the mesh get values and plot... in my case i want to plot directly...each poin (x,z) its magnitude(E_fiel_Mag) i do not think i need to use meshgrid any more how can i do my plot? below is my code...pls help me!!! #!/usr/bin/env python # This example demonstrates how to use a constraint polygon in # Delaunay triangulation. from scipy import* from pylab import* read_file= open ('W:/Serio/necfile.out','r') L =read_file.readlines() fieldlist =[] f = 0 for line in L: f=f+1 if 'NEAR ELECTRIC FIELDS'in line: rpoints = 3 phipoints = 3 tetapoints = 1 for line in range (f+3,f+4+rpoints*phipoints*tetapoints): fieldlist.append(L[line]) Ex = [];Ey = [];Ez = [] x1 =[];y1=[];z1=[] Exphase=[]; Eyphase=[]; Ezphase=[] for i in range(len(fieldlist)-1): splitlines= fieldlist[i].split() x1.append(float(splitlines[0])) #here we pick up the x,y,x coordinates of the points y1.append(float(splitlines[1])) #where the manitude has been calculated z1.append(float(splitlines[2])) Ex.append(float(splitlines[3])) #pick up the e-filed magnitudes Ey.append(float(splitlines[5])) #u append as floats instead os string for later calculations Ez.append(float(splitlines[7])) Exphase.append(float(splitlines[4])) # pick up the phases just in case they are needed Eyphase.append(float(splitlines[6])) Ezphase.append(float(splitlines[8])) read_file.close() # i want to see if i can calculate the magnitude of the electric field E_field_Mag = [] for i in range(len(Ex)): E_Magnitude = sqrt((Ex[i])**2 + (Ey[i])**2+(Ez[i])**2) E_field_Mag.append(E_Magnitude) #E_field_Mag = array(E_field_Mag) #y values are zero #X,Z = meshgrid(x1, z1) pcolor(x1,y1,E_field_Mag) - Mensaje original De: [EMAIL PROTECTED] [EMAIL PROTECTED] Para: matplotlib-users@lists.sourceforge.net Enviado: domingo, 30 de septiembre, 2007 12:53:11 Asunto: Matplotlib-users Digest, Vol 16, Issue 32 Send Matplotlib-users mailing list submissions to matplotlib-users@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/matplotlib-users or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than Re: Contents of Matplotlib-users digest... Today's Topics: 1. Re: NameError: global name '__loader__' is not defined (Eric Firing) 2. Re: plot cdf (Alan G Isaac) 3. Re: edgecolor with usetex=True,usedistiller='pdf' (Darren Dale) 4. Re: Problem with tick labels in scripts (John Hunter) 5. Using special characters (David Loyall) 6. Re: matplotlib - representation of nan values in2D (Dirk Zickermann) -- Message: 1 Date: Thu, 27 Sep 2007 14:46:13 -1000 From: Eric Firing [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] NameError: global name '__loader__' is not defined To: Hal Huntley [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1; format=flowed Hal Huntley wrote: Thanks to Eric Firing and Christopher Barker for input on trying to resolve the problem. Christopher said: %%% You might try just: easy_install numpy easy_install matplotlib. %%% I did that and now the problem moved and I get: === from pylab import * Traceback (most recent call last): File stdin, line 1, in ? File /usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/pylab.py, line 1, in ? from matplotlib.pylab import * File /usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/pylab.py, line 222, in ? new_figure_manager, draw_if_interactive, show = pylab_setup() File /usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/__init__.py, line 24, in pylab_setup globals(),locals(),[backend_name]) File /usr/lib/python2.4/site-packages/matplotlib-0.90.1-py2.4-linux-i686.egg/matplotlib/backends/backend_gtkagg.py, line 10, in ? from matplotlib.backends.backend_gtk import gtk,
[Matplotlib-users] pcolor
I i have tree lists 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 pcolor 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 pcolor(X, Y, Mag, shading='flat') colorbar() axis([-3,3,-3,3]) savefig('pcolor_demo') show() ¡Sé un mejor besador! Comparte todo lo que sabes sobre besos. 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@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] Rv: three-d contour plot(intensity or arrow plot)
every time i try to plot i have these error how can i avoid it? Traceback (most recent call last): File C:/Python24/contour.py, line 9, in -toplevel- import matplotlib.axes3d as p3 File C:\PYTHON24\lib\site-packages\matplotlib\axes3d.py, line 26, in -toplevel- import art3d File C:\PYTHON24\lib\site-packages\matplotlib\art3d.py, line 17, in -toplevel- import proj3d File C:\PYTHON24\lib\site-packages\matplotlib\proj3d.py, line 21, in -toplevel- cross = nx.cross AttributeError: 'module' object has no attribute 'cross' - Mensaje reenviado De: yadin Bocuma Rivas [EMAIL PROTECTED] Para: matplotlib-users@lists.sourceforge.net; [EMAIL PROTECTED] Enviado: domingo, 23 de septiembre, 2007 21:06:50 Asunto: three-d contour plot(intensity or arrow plot) hi ! I have an array of x,y,z 100 points(in tree-d) and at each point i have a correspoinding magnitude(of electric field) i want to generate a contour plot of these (intensity and if posible arrowsat every point) how can i do these please any thing to start. an example will be very helpfull ¡Sé un mejor asador! Aprende todo sobre asados en: http://telemundo.yahoo.com/promos/mejorasador.html ¡Sé un mejor fotógrafo! Perfecciona tu técnica y encuentra las mejores fotos. http://telemundo.yahoo.com/promos/mejorfotografo.html- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse012070mrt/direct/01/___ Matplotlib-users mailing list Matplotlib-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/matplotlib-users
[Matplotlib-users] contour or intensity plot.
hi ! lets say i have an array of x,y 100 points and at each point i have a correspoinding magnitude(of electric field) i want to generate a contour plot of these intensity and if posible show contourn lines how can i do these please any thing to start. an example will be very helpfull - Mensaje original De: [EMAIL PROTECTED] [EMAIL PROTECTED] Para: matplotlib-users@lists.sourceforge.net Enviado: domingo, 23 de septiembre, 2007 22:06:00 Asunto: Matplotlib-users Digest, Vol 16, Issue 24 Send Matplotlib-users mailing list submissions to matplotlib-users@lists.sourceforge.net To subscribe or unsubscribe via the World Wide Web, visit https://lists.sourceforge.net/lists/listinfo/matplotlib-users or, via email, send a message with subject or body 'help' to [EMAIL PROTECTED] You can reach the person managing the list at [EMAIL PROTECTED] When replying, please edit your Subject line so it is more specific than Re: Contents of Matplotlib-users digest... Today's Topics: 1. Re: Screen location (John Hunter) 2. Re: Screen location (Christopher Barker) 3. Re: creating a timeline (John Hunter) 4. Legend colours for multiple histograms (Ed Schofield) 5. Re: Legend colours for multiple histograms (Jouni K. Sepp?nen) 6. three-d contour plot(intensity or arrow plot) (yadin Bocuma Rivas) 7. Rv: three-d contour plot(intensity or arrow plot) (yadin Bocuma Rivas) 8. Re: Rv: three-d contour plot(intensity or arrowplot) (Jouni K. Sepp?nen) -- Message: 1 Date: Fri, 21 Sep 2007 11:45:23 -0500 From: John Hunter [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] Screen location To: Yo mismo Hotmail [EMAIL PROTECTED] Cc: matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 On 9/21/07, Yo mismo Hotmail [EMAIL PROTECTED] wrote: Dear John, First of all, thanks for your response. When I try this fig = figure() fig.canvas.manager.window.move(100,400) python tells me that window has no attribute move. It's strange because I can choose many differents attributes like Well, the example I posted was for a *gtk* window, not a tk window. You will need to look at the API for the tk window to make the correct call. We do not provide an abstract API across the GUI windows we utilize internally. We give you access to the widget, and if you want to make GUI specific calls on it, good luck, but this is not encouraged or supported. JDH JDH -- Message: 2 Date: Fri, 21 Sep 2007 10:06:37 -0700 From: Christopher Barker [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] Screen location To: John Hunter [EMAIL PROTECTED] Cc: Yo mismo Hotmail [EMAIL PROTECTED], matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1; format=flowed John Hunter wrote: fig = figure() fig.canvas.manager.window.move(100,400) Well, the example I posted was for a *gtk* window, not a tk window. And, for what it's worth, wx spells it Move(), with a capital M. -Chris -- Christopher Barker, Ph.D. Oceanographer Emergency Response Division NOAA/NOS/ORR(206) 526-6959 voice 7600 Sand Point Way NE (206) 526-6329 fax Seattle, WA 98115 (206) 526-6317 main reception [EMAIL PROTECTED] -- Message: 3 Date: Fri, 21 Sep 2007 12:54:51 -0500 From: John Hunter [EMAIL PROTECTED] Subject: Re: [Matplotlib-users] creating a timeline To: Ryan Krauss [EMAIL PROTECTED] Cc: matplotlib-users matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=ISO-8859-1 On 9/20/07, Ryan Krauss [EMAIL PROTECTED] wrote: which also gets rid of my bottom x axis and leaves tick marks along the top (see attached). How do I get rid of the top tick marks, keep the bottom ones, and get the bottom x-axis back? I think this is what you are looking for: from pylab import figure, show fig = figure() ax = fig.add_subplot(111) ax.axesFrame.set_data((0,0,1), (1,0,0)) ax.axesPatch.set_edgecolor('white') ax.xaxis.set_ticks_position('bottom') ax.yaxis.set_ticks_position('left') ax.plot(range(10)) show() -- Message: 4 Date: Sat, 22 Sep 2007 16:53:57 +0100 From: Ed Schofield [EMAIL PROTECTED] Subject: [Matplotlib-users] Legend colours for multiple histograms To: Matplotlib-users@lists.sourceforge.net Message-ID: [EMAIL PROTECTED] Content-Type: text/plain; charset=UTF-8 Hi all, I'm superimposing histograms of two data sets on the same axes, using different colours and alpha transparency in the GtkAGG backend to show the overlapping regions. If I plot a legend as below, the colours in both legend entries are the same. Am I doing something wrong? import matplotlib matplotlib.use('GTKAgg') import pylab pylab.hist(data1, normed=True, alpha=0.8) pylab.hist(data2