Re: [Matplotlib-users] unpacking multiple files

2009-04-06 Thread Matthias Michler
Hi Bala, On Tuesday 31 March 2009 17:00:59 Bala subramanian wrote: > Friends, > > 1) I want to make a plot of multiple lines. I want to make something like > > ./multiplot.py 1.dat 2.dat 3.dat .. n.dat > > All files contain two columns and are of same length. plotfile() and load() > do not tak

[Matplotlib-users] Legend for smoothed lines

2009-04-06 Thread Sahar
I want to plot smooth line between data points (Excel like) and I can do it with with 2 lines: a.. Original data points as circles, for instance: plot(x, y, 'bo') b.. Spline of these points as line: plot(xnew, ynew, 'b-') The only problem with this is the legend - I get either 'o' or '---' but

Re: [Matplotlib-users] imread() and PNGs

2009-04-06 Thread Gregor Thalhammer
Eric Firing schrieb: > Gregor Thalhammer wrote: >> Tobias Wood >> [...] > [...] >> I also noticed you used C++ constructs in your code. I think this is >> not recommended. > > Gregor, > > Would you elaborate, please, to satisfy my curiosity? The original > file is C++, so use of C++ constructs i

Re: [Matplotlib-users] Plotting Scalar on a Circular Grid

2009-04-06 Thread Lorenzo Isella
Hello, So maybe a couple of images can help. Using the code #!/usr/bin/env python """ See pcolor_demo2 for a much faster way of generating pcolor plots """ from __future__ import division from pylab import * def func3(x,y): return (1- x/2 + x**5 + y**3)*exp(-x**2-y**2) def func4(x,y): th

Re: [Matplotlib-users] problem with basemap & my data arrays, gap around plot edge

2009-04-06 Thread Jeff Whitaker
P.Romero wrote: > > Hi, > > Im having a problem with contourf & basemap; > > theres a fairly wide gap showing up around the top&left edges of my plot. > > Im trying to do the following: > > Import numpy as np > > Z=my_data( …) > > m=basemap( … ) > > X,Y=m(*np.meshgrid(Z.lon,Z.lat)) > > Znp=Z.filled

Re: [Matplotlib-users] Legend for smoothed lines

2009-04-06 Thread Jae-Joon Lee
The easiest solution would be to use a proxy(?) artist. For example, l1, = plot(x, y, "bo") # original points l2, = plot(xnew, ynew, "b-") # interpolated line l3, = plot(x, y, "bo-") # just for the legend l3.remove() # remove the line from the axes so that it is not drawn. legend([ll3

Re: [Matplotlib-users] Plotting Scalar on a Circular Grid

2009-04-06 Thread Jae-Joon Lee
There are a few ways to do that depending on exactly what you want. From your script, you may just clip your image. im = imshow(Z, extent=(-1, 1, -1, 1)) im.set_clip_path(Circle((0,0),1, transform=ax.transData)) (Note the use of extent keyword in imshow) Or, You can use polar coordinate with p

[Matplotlib-users] ylabel not visible if yscale ~1E-6

2009-04-06 Thread João Luís Silva
Hi, I found a minor bug, feel free to ignore it :) . If the vertical scale of a plot has numbers ~1E-6 the ylabel won't be visible. Example script: #--- import matplotlib.pyplot as plt import numpy as np x = np.arange(-10.0,10.0,0.1) plt.plot(x,1E-6*np.si

Re: [Matplotlib-users] making the space between ticks

2009-04-06 Thread Jouni K . Seppänen
Chaitanya Krishna writes: > That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space > in between V and [. Like TeX, matplotlib ignores spaces in math mode and uses spacing derived from the usual roles of the symbols. You need to use an explicit command to add space. > I also trie

Re: [Matplotlib-users] making the space between ticks

2009-04-06 Thread Troels Kofoed Jacobsen
On Monday 06 April 2009 20:15:47 Jouni K. Seppänen wrote: > Chaitanya Krishna writes: > > That is, when I use pylab.ylabel(r'$V [A^{3}]$') I don't get any space > > in between V and [. > > Like TeX, matplotlib ignores spaces in math mode and uses spacing > derived from the usual roles of the symbo

[Matplotlib-users] colorbar with 2 different scales

2009-04-06 Thread P.Romero
Is it possible to create a colorbar with different scales on each side? Example: a temperature colorbar with celcius values on the left side and farenheit values on the right side. If so, how could this be done? Please help, Thanks, P.Romero

Re: [Matplotlib-users] colorbar with 2 different scales

2009-04-06 Thread Eric Firing
P.Romero wrote: > Is it possible to create a colorbar with different scales on each side? > > > > Example: > > a temperature colorbar with celcius values on the left side and > farenheit values on the right side. > > > > If so, how could this be done? A colorbar is just an axes object w

Re: [Matplotlib-users] problem with basemap & my data arrays, gap around plot edge

2009-04-06 Thread Jeff Whitaker
P.Romero wrote: > Jeff, > I've attached a test script and my data file. > Unfortunately, the method that Im using to create the data set isn't very > portable (the data is being imported from an external program), so sending > my .npz file is the best I can do. > > The gaps are about 5 pixels, and

[Matplotlib-users] New/Fixed Simple Animation Example

2009-04-06 Thread Nathaniel Troutman
I don't know who I should notify about this, but I've found a fix for simple animation. If one uses the code found here: http://matplotlib.sourceforge.net/examples/animation/simple_anim_gtk.html it works okay, but if you try to move the window it freezes, and you can't use anything on the toolb

Re: [Matplotlib-users] plot() in a loop vs multiple curves with a single plot()

2009-04-06 Thread Jouni K . Seppänen
A B writes: > I have the following code and am wondering whether there is a more > efficient way to plot multiple curves. Maybe somehow accumulating the > data into a single variable, then calling plot once ... Thanks for any > ideas. > > for ofile in files: > d = mlab.csv2rec(ofile, names =

Re: [Matplotlib-users] New/Fixed Simple Animation Example

2009-04-06 Thread Nathaniel Troutman
In regards to my previous example, the lambda function magic is unnecessary, instead of: gobject.idle_add(lambda iter=animate(): iter.next()) It is simply adequate to do: gobject.idle_add(animate().next) Which is much simpler. My apologies for over coding the solution. -- Nathaniel --

[Matplotlib-users] 2 axes bar chart -- malformed header from script. Bad headerRe: colorbar with 2 different scales

2009-04-06 Thread j bai
Hi, P.Romero, Please let me know if you get this working. I am trying to do the same type of 2 axes bar chart. but I got error message. I am using regular bar (). the following is the email i sent a week ago. Eric, I did use the twinx(), but it gave errors. thanks in advance. Hi, everyone,

Re: [Matplotlib-users] 2 axes bar chart -- malformed header from script. Bad headerRe: colorbar with 2 different scales

2009-04-06 Thread Eric Firing
j bai wrote: > Hi, P.Romero, > Please let me know if you get this working. I am trying to do the same > type of 2 axes bar chart. but I got error message. > I am using regular bar (). > the following is the email i sent a week ago. Eric, I did use the > twinx(), but it gave errors. >

[Matplotlib-users] Installing Matplotlib

2009-04-06 Thread Constantine
Hi, sorry to bother you. This may be a trivial question for experienced Matplotlib users. I am trying to install Matplotlib under Windows XP but with no success. I am not familiar with Python or any of the other packages and I've never used Matplotlib before. I followed the instructions in the Mat

Re: [Matplotlib-users] Installing Matplotlib

2009-04-06 Thread brett . mcsweeney
A quick but not necessarily accurate answer: Don't use Python 2.6. Use Python 2.5. I don't think matplotlib has been 'certified' for 2.6 yet. I suggest (1) uninstall Python 2.6 and numpy for 2.6. (2) Install Python 2.5 and numpy for 2.5 (3) Install matplotlib for 2.5 Constantine 0

[Matplotlib-users] Linear regression question

2009-04-06 Thread Juls Night
I'm new to matplotlib and am really enjoying using it. I'm confused by something though: If I plot the following linear regression it works as expected. from pylab import * x = range(10) y = range(10) m,b = polyfit(x, y, 1) plot(x, y, 'yo', x, m*x+b, '--k') show() The following code produces

Re: [Matplotlib-users] Linear regression question

2009-04-06 Thread Eric Firing
Juls Night wrote: > I'm new to matplotlib and am really enjoying using it. I'm confused by > something > though: [...] > The following code produces an error though (only the length of the vectors > have > been changed): > > from pylab import * > > x = range(11) > y = range(11) > > m,b = polyf

[Matplotlib-users] Custom made colormaps

2009-04-06 Thread Gökhan SEVER
Hello, I am trying convert a plot written in IDL to Python using matplotlib. So far, I have managed to show the image on the screen equivalent to its IDL output. The only problem that I could not figure out matching the colormaps between them. Please see the results on this png image: http://img51

Re: [Matplotlib-users] Custom made colormaps

2009-04-06 Thread Eric Firing
Gökhan SEVER wrote: > Hello, > > I am trying convert a plot written in IDL to Python using matplotlib. So > far, I have managed to show the image on the screen equivalent to its > IDL output. The only problem that I could not figure out matching the > colormaps between them. Please see the resu

Re: [Matplotlib-users] Linear regression question

2009-04-06 Thread Juls Night
Eric Firing writes: > > Solution: use > x = arange(11) > y = arange(11) > > Eric Thanks Eric, That has solved my problem! Best, Juls -- This SF.net email is sponsored by: High Quality Requirements in a Collaborat