[Matplotlib-users] Smooth contourplots

2010-07-26 Thread montefra

Hi,

I am writing a program that reads three columns (one column containing the
weights, the other two containing the values I want to plot) from a file
containing the results from a MonteCarlo Markov Chain. The file contains
thousends of lines. Then create the 2D histogram and make contourplots. Here
is a sample of the code (I don't know if is correct, it's just to show what
I do)

 import numpy as np
 import matplotlib.pyplot as mplp
 chain = np.loadtxt(chain.txt, usecols=[0,4,6])   #read columns 0 (the
 weights), 4 and 6 (the data), from the file chain.txt
 h2D, xe, ye = np.histogram2D(chain[:,1],chain[:,2], weights=chain[:,0]) 
 #create the 2D histogram
 x = (xe[:-1] + xe[1:])/2. #x and y values for the plot (I use the mean
 of each bin)
 y = (ye[:-1] + ye[1:])/2.
 mplp.figure()   #open the figure
 mplp.contourf(x, y, h2D.T, origin='lower')  #contour plot

As it is the contours are not smooth and they look not that nice. After days
of searches I've found three methods and tried, unsuccesfully, to apply them
1) 2d interpolation: I got segmentation fault (on a quadcore machine with
8Gb of RAM)
2) Rbf (radial basis functions): I got wrong contours
3) ndimage: it creates spurious features (like secondary peaks parallel to
the direction of the main one)

Before beginning with Python, I used to use IDL to plot, and there is a
function 'smooth' that smooth for you 2D histograms. I haven't found
anything similar for Python.
Does anyone have an idea or suggestion on how to do it?

Thank in advance
Francesco

-- 
View this message in context: 
http://old.nabble.com/Smooth-contourplots-tp29253884p29253884.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Matplotlib-users Digest, Vol 50, Issue 37

2010-07-26 Thread Waléria Antunes David
Hello all,

I need to format the values of graphic to KHz.my values are in Hz
see at idle python it displays the values as: 3000 3050 3100  3400 , but
I need to go where it will be displayed KHz:  3.0 3.1

can someone help me?



On Thu, Jul 15, 2010 at 10:48 AM, 
matplotlib-users-requ...@lists.sourceforge.net wrote:

 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
matplotlib-users-requ...@lists.sourceforge.net

 You can reach the person managing the list at
matplotlib-users-ow...@lists.sourceforge.net

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Matplotlib-users digest...


 Today's Topics:

   1. scientific notation (Wal?ria Antunes David)


 --

 Message: 1
 Date: Thu, 15 Jul 2010 10:41:52 -0300
 From: Wal?ria Antunes David waleriantu...@gmail.com
 Subject: [Matplotlib-users] scientific notation
 To: matplotlib-users@lists.sourceforge.net
 Message-ID:
aanlktimgokwxnsavxwym9ycvkvhmfpbky4fxv10_y...@mail.gmail.com
 Content-Type: text/plain; charset=iso-8859-1

 Hi all,

 I have a code base so that:


 from pylab import *
 x = arange (3000,3400)
 y = -108 * (3.0e14 ** 2)/x**2

 pylab..title(Teste)
 pylab.savefig(imagem.png)
 plot(x, y)


 Well the values of the function range(3000,3400) are in Hz..i need
 to pass GHz which would be in scientific notation as follows bellow:

 3000 Hz = 3,0 ? 10-6 GHz
 3400 Hz = 3,4 x 10-6 Ghz

 How do I make the graph x-axis is shown in figures
 scientific notation, for this currently so

 3000,3050,3100,,3400

 in scientific notation is: (3.0e-6,  3.4e-6)

 Can someone help me?

 See my attachment

 I need to show this values in scientific notation..

 Wal?ria
 -- next part --
 An HTML attachment was scrubbed...
 -- next part --
 A non-text attachment was scrubbed...
 Name: current_image.jpg
 Type: image/jpeg
 Size: 35656 bytes
 Desc: not available

 --


 --
 This SF.net email is sponsored by Sprint
 What will you do first with EVO, the first 4G phone?
 Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first

 --

 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


 End of Matplotlib-users Digest, Vol 50, Issue 37
 

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Documentation error/bug?

2010-07-26 Thread Josh Lawrence
  Hello,

I looked on your website for the different line styles. In the 
documentation for matplotlib.lines.line2D.set_linestyle, the dashed 
linestyle is listed as '-' and not '--'. It it my understanding that 
dashed should be '--'. If I'm incorrect, sorry for the noise.

Cheers,

-- 
Josh Lawrence
Ph.D. Student
Clemson University


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Import matplotlib.pyplot fails on windows XP

2010-07-26 Thread eck naysmith

Hello,

I've installed the following Python packages on a Windows XP machine:

Python 2.6.5

Python 2.6 numpy-1.4.1

Python 2.6 matplotlib-0.99.3 [installer - matplotlib-0.99.3.win32-py2.6]

Python and Numpy work correctly. Matplotlib also works and as a test I tried 
successfully the following on the python interpretor:

from matplotlib.pyplot import *
plot([1,2,3])
show()

A graph then appears and thus so far so good.

However, when I try to run a certain python script, a problem occurs when 
importing from matplotlib:









Traceback (most recent
call last):
  File
C:\Pythoncode\Games\Bridge_war_2\unitload2.py, line 2, in
module
from matplotlib.pyplot
import plot, ylabel,xlabel, show
  File
C:\Python26\lib\site-packages\matplotlib\pyplot.py, line
78, in module
new_figure_manager,
draw_if_interactive, show = pylab_setup()
  File
C:\Python26\lib\site-packages\matplotlib\backends\__init__.py,
line 25, in pylab_setup
globals(),locals(),[backend_name])
  File
C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py,
line 7, in module
import Tkinter as Tk,
FileDialog
  File
C:\Python26\lib\lib-tk\FileDialog.py, line 12, in
module
from Dialog import
Dialog
  File
C:\Pythoncode\Games\Bridge_war_2\Dialog.py, line 2, in
module
import  wx
ImportError: No module
named wx
And then no graph appears.


The same script works fine on my Linux computers. On the unitload2.py script, 
the following is imported:

from numpy import array, append, .. 
from numpy.linalg import solve

No further modules are imported. Once I've ran the unitload2.py script, that 
session of the python interpretor produces the same error when I try a test 
plot again.

Regards

Alex









  
_
http://clk.atdmt.com/UKM/go/19780/direct/01/
Do you have a story that started on Hotmail? Tell us now--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Import matplotlib.pyplot fails on windows XP

2010-07-26 Thread Benjamin Root
On Sat, Jul 24, 2010 at 4:57 AM, eck naysmith ecker...@hotmail.com wrote:

  Hello,

 I've installed the following Python packages on a Windows XP machine:

 Python 2.6.5

 Python 2.6 numpy-1.4.1

 Python 2.6 matplotlib-0.99.3 [installer - matplotlib-0.99.3.win32-py2.6]

 Python and Numpy work correctly. Matplotlib also works and as a test I
 tried successfully the following on the python interpretor:

 from matplotlib.pyplot import *
 plot([1,2,3])
 show()

 A graph then appears and thus so far so good.

 However, when I try to run a certain python script, a problem occurs when
 importing from matplotlib:

 Traceback (most recent call last):

 File C:\Pythoncode\Games\Bridge_war_2\unitload2.py, line 2, in module

 from matplotlib.pyplot import plot, ylabel,xlabel, show

 File C:\Python26\lib\site-packages\matplotlib\pyplot.py, line 78, in
 module

 new_figure_manager, draw_if_interactive, show = pylab_setup()

 File C:\Python26\lib\site-packages\matplotlib\backends\__init__.py, line
 25, in pylab_setup

 globals(),locals(),[backend_name])

 File C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py,
 line 7, in module

 import Tkinter as Tk, FileDialog

 File C:\Python26\lib\lib-tk\FileDialog.py, line 12, in module

 from Dialog import Dialog

 File C:\Pythoncode\Games\Bridge_war_2\Dialog.py, line 2, in module

 import wx

 ImportError: No module named wx



The error is that your Windows XP box does not have the wxPython module
installed for Windows.

http://www.wxpython.org/download.php

I hope that helps,

Ben Root
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Documentation error/bug?

2010-07-26 Thread Benjamin Root
On Sat, Jul 24, 2010 at 1:51 PM, Josh Lawrence josh.k.lawre...@gmail.comwrote:

  Hello,

 I looked on your website for the different line styles. In the
 documentation for matplotlib.lines.line2D.set_linestyle, the dashed
 linestyle is listed as '-' and not '--'. It it my understanding that
 dashed should be '--'. If I'm incorrect, sorry for the noise.

 Cheers,

 --
 Josh Lawrence
 Ph.D. Student
 Clemson University



Looks like the formatter for the online documentation took the double-dash
to mean a long line, much like how LaTeX does.  Anybody know how to make
the double-dash appear as two distinct dashes?

http://matplotlib.sourceforge.net/api/artist_api.html?highlight=set_linestyle#matplotlib.lines.Line2D.set_linestyle

Ben Root
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow and projection axes

2010-07-26 Thread Tobias Winchen
Hi, thank you for your quick answers which pointed me to a solution:

setting clip_on=False solves the problem:

 pylab.imshow(d, extent=(-pi,pi,-pi/2,pi/2), clip_on=False)

However, for me it feels  not very intuitive  to write clip_on=False to 
activate the desired clipping.

Tobias



signature.asc
Description: This is a digitally signed message part.
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Hz to KHz

2010-07-26 Thread Waléria Antunes David
Hello all,

I need to format the values of graphic to KHz.my values are in Hz
see at idle python it displays the values as: 3000 3050 3100  3400 , but
I need to go where it will be displayed KHz:  3.0 3.1

can someone help me?
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Matthieu Brucher
Hi,

You may just divide them by 1000?

Matthieu

2010/7/26 Waléria Antunes David waleriantu...@gmail.com:
 Hello all,

 I need to format the values of graphic to KHz.my values are in Hz
 see at idle python it displays the values as: 3000 3050 3100  3400 , but
 I need to go where it will be displayed KHz:  3.0 3.1

 can someone help me?
 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





-- 
Information System Engineer, Ph.D.
Blog: http://matt.eifelle.com
LinkedIn: http://www.linkedin.com/in/matthieubrucher

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Waléria Antunes David
I know...I tried but I'm using django and also when divided by 1000 the
image does not appear...
I don't know what to do.help me

On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher 
matthieu.bruc...@gmail.com wrote:

 Hi,

 You may just divide them by 1000?

 Matthieu

 2010/7/26 Waléria Antunes David waleriantu...@gmail.com:
  Hello all,
 
  I need to format the values of graphic to KHz.my values are in Hz
  see at idle python it displays the values as: 3000 3050 3100  3400 ,
 but
  I need to go where it will be displayed KHz:  3.0 3.1
 
  can someone help me?
 
 --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 Information System Engineer, Ph.D.
 Blog: http://matt.eifelle.com
 LinkedIn: http://www.linkedin.com/in/matthieubrucher

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Smooth contourplots

2010-07-26 Thread Joe Kington
It sounds like you're wanting a gaussian kernel density estimate (KDE) (not
the desktop!).  The other options you mentioned are for interpolation, and
are not at all what you're wanting to do.

You can use 
scipy.stats.kde.gaussian_kde()http://www.scipy.org/doc/api_docs/SciPy.stats.kde.gaussian_kde.html.
However, it currently doesn't take a weights array, so you'll need to modify
it for your use case.

If you prefer, I have faster version of a gaussian KDE that can take a
weights array.  It's actually slower than the scipy's gaussian kde for a low
number of points, but for hundreds, thousands, or millions of points, it's
several orders of magnitude faster.  (Though the speedup depends on the
covariance of the points... higher covariance = slower, generally speaking)

Here's a quick pastebin of the code.  http://pastebin.com/LNdYCZgw

To use it, you do something like the below... (assuming the code in the
pastebin is saved in a file called fast_kde.py)

import numpy as np
import matplotlib.pyplot as plt
from fast_kde import fast_kde

# From your description of your data...
weights, x, y = np.loadtxt('chain.txt', usecols=(0,4,6)).T

kde_grid = fast_kde(x, y, gridsize=(200,200), weights=weights)

# Plot the grid
plt.figure()
plt.imshow(kde_grid, extent=(x.min(), x.max(), y.max(), y.min())

# Reverse the y-axis
plt.gca().invert_yaxis()

plt.show()

Hope that helps a bit,
-Joe




On Sat, Jul 24, 2010 at 3:56 AM, montefra franz.berges...@googlemail.comwrote:


 Hi,

 I am writing a program that reads three columns (one column containing the
 weights, the other two containing the values I want to plot) from a file
 containing the results from a MonteCarlo Markov Chain. The file contains
 thousends of lines. Then create the 2D histogram and make contourplots.
 Here
 is a sample of the code (I don't know if is correct, it's just to show what
 I do)

  import numpy as np
  import matplotlib.pyplot as mplp
  chain = np.loadtxt(chain.txt, usecols=[0,4,6])   #read columns 0 (the
  weights), 4 and 6 (the data), from the file chain.txt
  h2D, xe, ye = np.histogram2D(chain[:,1],chain[:,2], weights=chain[:,0])
  #create the 2D histogram
  x = (xe[:-1] + xe[1:])/2. #x and y values for the plot (I use the mean
  of each bin)
  y = (ye[:-1] + ye[1:])/2.
  mplp.figure()   #open the figure
  mplp.contourf(x, y, h2D.T, origin='lower')  #contour plot

 As it is the contours are not smooth and they look not that nice. After
 days
 of searches I've found three methods and tried, unsuccesfully, to apply
 them
 1) 2d interpolation: I got segmentation fault (on a quadcore machine with
 8Gb of RAM)
 2) Rbf (radial basis functions): I got wrong contours
 3) ndimage: it creates spurious features (like secondary peaks parallel to
 the direction of the main one)

 Before beginning with Python, I used to use IDL to plot, and there is a
 function 'smooth' that smooth for you 2D histograms. I haven't found
 anything similar for Python.
 Does anyone have an idea or suggestion on how to do it?

 Thank in advance
 Francesco

 --
 View this message in context:
 http://old.nabble.com/Smooth-contourplots-tp29253884p29253884.html
 Sent from the matplotlib - users mailing list archive at Nabble.com.



 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Waléria Antunes David
My code like this in django: http://pastebin.com/nzM5jvuc

i'm lost

On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.com wrote:

  Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
 any integer nonsense and make sure to reset your axis limits.



 Posting a small code snippet would help us get you on the right track.

 -p



 *From:* Waléria Antunes David [mailto:waleriantu...@gmail.com]
 *Sent:* Monday, July 26, 2010 9:32 AM
 *To:* Matthieu Brucher
 *Cc:* matplotlib-users@lists.sourceforge.net
 *Subject:* Re: [Matplotlib-users] Hz to KHz



 I know...I tried but I'm using django and also when divided by 1000 the
 image does not appear...
 I don't know what to do.help me

 On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher 
 matthieu.bruc...@gmail.com wrote:

 Hi,

 You may just divide them by 1000?

 Matthieu

 2010/7/26 Waléria Antunes David waleriantu...@gmail.com:

  Hello all,
 
  I need to format the values of graphic to KHz.my values are in Hz
  see at idle python it displays the values as: 3000 3050 3100  3400 ,
 but
  I need to go where it will be displayed KHz:  3.0 3.1
 
  can someone help me?

 
 --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 Information System Engineer, Ph.D.
 Blog: http://matt.eifelle.com
 LinkedIn: http://www.linkedin.com/in/matthieubrucher



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Angus McMorland
On 26 July 2010 12:47, Waléria Antunes David waleriantu...@gmail.com wrote:
 My code like this in django: http://pastebin.com/nzM5jvuc

Are you perhaps suffering from integer division? How about dividing by
1000.0, instead of 1000?

Angus.

 i'm lost

 On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.com wrote:

 Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid any
 integer nonsense and make sure to reset your axis limits.



 Posting a small code snippet would help us get you on the right track.

 -p



 From: Waléria Antunes David [mailto:waleriantu...@gmail.com]
 Sent: Monday, July 26, 2010 9:32 AM
 To: Matthieu Brucher
 Cc: matplotlib-users@lists.sourceforge.net
 Subject: Re: [Matplotlib-users] Hz to KHz



 I know...I tried but I'm using django and also when divided by 1000 the
 image does not appear...
 I don't know what to do.help me

 On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher
 matthieu.bruc...@gmail.com wrote:

 Hi,

 You may just divide them by 1000?

 Matthieu

 2010/7/26 Waléria Antunes David waleriantu...@gmail.com:

  Hello all,
 
  I need to format the values of graphic to KHz.my values are in Hz
  see at idle python it displays the values as: 3000 3050 3100  3400 ,
  but
  I need to go where it will be displayed KHz:  3.0 3.1
 
  can someone help me?

 
  --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 Information System Engineer, Ph.D.
 Blog: http://matt.eifelle.com
 LinkedIn: http://www.linkedin.com/in/matthieubrucher



 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Waléria Antunes David
i don't understand..

On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland amcm...@gmail.com wrote:

 On 26 July 2010 12:47, Waléria Antunes David waleriantu...@gmail.com
 wrote:
  My code like this in django: http://pastebin.com/nzM5jvuc

 Are you perhaps suffering from integer division? How about dividing by
 1000.0, instead of 1000?

 Angus.

  i'm lost
 
  On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.com wrote:
 
  Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
 any
  integer nonsense and make sure to reset your axis limits.
 
 
 
  Posting a small code snippet would help us get you on the right track.
 
  -p
 
 
 
  From: Waléria Antunes David [mailto:waleriantu...@gmail.com]
  Sent: Monday, July 26, 2010 9:32 AM
  To: Matthieu Brucher
  Cc: matplotlib-users@lists.sourceforge.net
  Subject: Re: [Matplotlib-users] Hz to KHz
 
 
 
  I know...I tried but I'm using django and also when divided by 1000 the
  image does not appear...
  I don't know what to do.help me
 
  On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher
  matthieu.bruc...@gmail.com wrote:
 
  Hi,
 
  You may just divide them by 1000?
 
  Matthieu
 
  2010/7/26 Waléria Antunes David waleriantu...@gmail.com:
 
   Hello all,
  
   I need to format the values of graphic to KHz.my values are in Hz
   see at idle python it displays the values as: 3000 3050 3100  3400
 ,
   but
   I need to go where it will be displayed KHz:  3.0 3.1
  
   can someone help me?
 
  
  
 --
   The Palm PDK Hot Apps Program offers developers who use the
   Plug-In Development Kit to bring their C/C++ apps to Palm for a share
   of $1 Million in cash or HP Products. Visit us here for more details:
   http://ad.doubleclick.net/clk;226879339;13503038;l?
   http://clk.atdmt.com/CRS/go/247765532/direct/01/
   ___
   Matplotlib-users mailing list
   Matplotlib-users@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
  
 
 
 
  --
  Information System Engineer, Ph.D.
  Blog: http://matt.eifelle.com
  LinkedIn: http://www.linkedin.com/in/matthieubrucher
 
 
 
 
 --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread PHobson
Replace this line:
  ax.plot(f/1000, Sserie)

With this line:
  ax.plot(f/1000.0, Sserie)

And tell us how things go. Python 2.6 distinguishes between integers and floats 
very strictly. Hence:
In [1]: 20/1000
Out[1]: 0

In [2]: 20.0/1000.0
Out[2]: 0.02

See the difference?
-paul

From: Waléria Antunes David [mailto:waleriantu...@gmail.com]
Sent: Monday, July 26, 2010 10:01 AM
To: Angus McMorland
Cc: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] Hz to KHz

i don't understand..
On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland 
amcm...@gmail.commailto:amcm...@gmail.com wrote:
On 26 July 2010 12:47, Waléria Antunes David 
waleriantu...@gmail.commailto:waleriantu...@gmail.com wrote:
 My code like this in django: http://pastebin.com/nzM5jvuc
Are you perhaps suffering from integer division? How about dividing by
1000.0, instead of 1000?

Angus.

 i'm lost

 On Mon, Jul 26, 2010 at 1:42 PM, 
 phob...@geosyntec.commailto:phob...@geosyntec.com wrote:

 Make sure that you're dividing by 1000.0 (as opposed to 1000) to avoid any
 integer nonsense and make sure to reset your axis limits.



 Posting a small code snippet would help us get you on the right track.

 -p



 From: Waléria Antunes David 
 [mailto:waleriantu...@gmail.commailto:waleriantu...@gmail.com]
 Sent: Monday, July 26, 2010 9:32 AM
 To: Matthieu Brucher
 Cc: 
 matplotlib-users@lists.sourceforge.netmailto:matplotlib-users@lists.sourceforge.net
 Subject: Re: [Matplotlib-users] Hz to KHz



 I know...I tried but I'm using django and also when divided by 1000 the
 image does not appear...
 I don't know what to do.help me

 On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher
 matthieu.bruc...@gmail.commailto:matthieu.bruc...@gmail.com wrote:

 Hi,

 You may just divide them by 1000?

 Matthieu

 2010/7/26 Waléria Antunes David 
 waleriantu...@gmail.commailto:waleriantu...@gmail.com:

  Hello all,
 
  I need to format the values of graphic to KHz.my values are in Hz
  see at idle python it displays the values as: 3000 3050 3100  3400 ,
  but
  I need to go where it will be displayed KHz:  3.0 3.1
 
  can someone help me?

 
  --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 Information System Engineer, Ph.D.
 Blog: http://matt.eifelle.com
 LinkedIn: http://www.linkedin.com/in/matthieubrucher



 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.netmailto:Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users





--
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Angus McMorland
On 26 July 2010 13:01, Waléria Antunes David waleriantu...@gmail.com wrote:
 i don't understand..

python (version  3, I think) uses integer division when given integer
values, i.e. 1/1000 = 0, at the expense of giving a less accurate
answer than we might expect. If you tried to plot a bunch of values
divided by 1000, they may well all be integer 0, and so you wouldn't
see any line (it would be at the x-axis). You would need to force
python to do floating point division: 1/1000.0 = 0.001; to do this you
need to make sure one of the numbers in the division is floating
point: the simplest way to do this is 1/1000.0 (or 1/1000. for short).

I hope that helps,

Angus.

 On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland amcm...@gmail.com wrote:

 On 26 July 2010 12:47, Waléria Antunes David waleriantu...@gmail.com
 wrote:
  My code like this in django: http://pastebin.com/nzM5jvuc

 Are you perhaps suffering from integer division? How about dividing by
 1000.0, instead of 1000?

 Angus.

  i'm lost
 
  On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.com wrote:
 
  Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
  any
  integer nonsense and make sure to reset your axis limits.
 
 
 
  Posting a small code snippet would help us get you on the right track.
 
  -p
 
 
 
  From: Waléria Antunes David [mailto:waleriantu...@gmail.com]
  Sent: Monday, July 26, 2010 9:32 AM
  To: Matthieu Brucher
  Cc: matplotlib-users@lists.sourceforge.net
  Subject: Re: [Matplotlib-users] Hz to KHz
 
 
 
  I know...I tried but I'm using django and also when divided by 1000 the
  image does not appear...
  I don't know what to do.help me
 
  On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher
  matthieu.bruc...@gmail.com wrote:
 
  Hi,
 
  You may just divide them by 1000?
 
  Matthieu
 
  2010/7/26 Waléria Antunes David waleriantu...@gmail.com:
 
   Hello all,
  
   I need to format the values of graphic to KHz.my values are in Hz
   see at idle python it displays the values as: 3000 3050 3100 
   3400 ,
   but
   I need to go where it will be displayed KHz:  3.0 3.1
  
   can someone help me?
 
  
  
   --
   The Palm PDK Hot Apps Program offers developers who use the
   Plug-In Development Kit to bring their C/C++ apps to Palm for a share
   of $1 Million in cash or HP Products. Visit us here for more details:
   http://ad.doubleclick.net/clk;226879339;13503038;l?
   http://clk.atdmt.com/CRS/go/247765532/direct/01/
   ___
   Matplotlib-users mailing list
   Matplotlib-users@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
  
 
 
 
  --
  Information System Engineer, Ph.D.
  Blog: http://matt.eifelle.com
  LinkedIn: http://www.linkedin.com/in/matthieubrucher
 
 
 
 
  --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --
 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh





-- 
AJC McMorland
Post-doctoral research fellow
Neurobiology, University of Pittsburgh

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Tim Gray
On Jul 26, 2010 at 02:01 PM -0300, Waléria Antunes David wrote:
 i don't understand..

Just divide through by '1000.' or '1000.0' (same thing).

If you write 3100/1000, you'll get '3' because you are doing integer math. 
If you write 3100/1000.0, you'll get '3.1' because you are doing float math.

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Hz to KHz

2010-07-26 Thread Waléria Antunes David
I did what you showed me but the image disappears

On Mon, Jul 26, 2010 at 2:06 PM, phob...@geosyntec.com wrote:

  Replace this line:

   ax.plot(f/1000, Sserie)



 With this line:

   ax.plot(f/1000.0, Sserie)



 And tell us how things go. Python 2.6 distinguishes between integers and
 floats very strictly. Hence:

 In [1]: 20/1000

 Out[1]: 0



 In [2]: 20.0/1000.0

 Out[2]: 0.02



 See the difference?

 -paul



 *From:* Waléria Antunes David [mailto:waleriantu...@gmail.com]
 *Sent:* Monday, July 26, 2010 10:01 AM
 *To:* Angus McMorland

 *Cc:* matplotlib-users@lists.sourceforge.net
 *Subject:* Re: [Matplotlib-users] Hz to KHz



 i don't understand..

 On Mon, Jul 26, 2010 at 1:57 PM, Angus McMorland amcm...@gmail.com
 wrote:

 On 26 July 2010 12:47, Waléria Antunes David waleriantu...@gmail.com
 wrote:
  My code like this in django: http://pastebin.com/nzM5jvuc

 Are you perhaps suffering from integer division? How about dividing by
 1000.0, instead of 1000?

 Angus.


  i'm lost
 
  On Mon, Jul 26, 2010 at 1:42 PM, phob...@geosyntec.com wrote:
 
  Make sure that you’re dividing by 1000.0 (as opposed to 1000) to avoid
 any
  integer nonsense and make sure to reset your axis limits.
 
 
 
  Posting a small code snippet would help us get you on the right track.
 
  -p
 
 
 
  From: Waléria Antunes David [mailto:waleriantu...@gmail.com]
  Sent: Monday, July 26, 2010 9:32 AM
  To: Matthieu Brucher
  Cc: matplotlib-users@lists.sourceforge.net
  Subject: Re: [Matplotlib-users] Hz to KHz
 
 
 
  I know...I tried but I'm using django and also when divided by 1000 the
  image does not appear...
  I don't know what to do.help me
 
  On Mon, Jul 26, 2010 at 1:27 PM, Matthieu Brucher
  matthieu.bruc...@gmail.com wrote:
 
  Hi,
 
  You may just divide them by 1000?
 
  Matthieu
 
  2010/7/26 Waléria Antunes David waleriantu...@gmail.com:
 
   Hello all,
  
   I need to format the values of graphic to KHz.my values are in Hz
   see at idle python it displays the values as: 3000 3050 3100  3400
 ,
   but
   I need to go where it will be displayed KHz:  3.0 3.1
  
   can someone help me?
 
  
  
 --
   The Palm PDK Hot Apps Program offers developers who use the
   Plug-In Development Kit to bring their C/C++ apps to Palm for a share
   of $1 Million in cash or HP Products. Visit us here for more details:
   http://ad.doubleclick.net/clk;226879339;13503038;l?
   http://clk.atdmt.com/CRS/go/247765532/direct/01/
   ___
   Matplotlib-users mailing list
   Matplotlib-users@lists.sourceforge.net
   https://lists.sourceforge.net/lists/listinfo/matplotlib-users
  
  
 
 
 
  --
  Information System Engineer, Ph.D.
  Blog: http://matt.eifelle.com
  LinkedIn: http://www.linkedin.com/in/matthieubrucher
 
 
 
 
 --
  The Palm PDK Hot Apps Program offers developers who use the
  Plug-In Development Kit to bring their C/C++ apps to Palm for a share
  of $1 Million in cash or HP Products. Visit us here for more details:
  http://ad.doubleclick.net/clk;226879339;13503038;l?
  http://clk.atdmt.com/CRS/go/247765532/direct/01/
  ___
  Matplotlib-users mailing list
  Matplotlib-users@lists.sourceforge.net
  https://lists.sourceforge.net/lists/listinfo/matplotlib-users
 
 



 --

 AJC McMorland
 Post-doctoral research fellow
 Neurobiology, University of Pittsburgh



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Plotting with varied marker sizes, or a scatter with connecting lines?

2010-07-26 Thread Timothy Vickery
Hi everyone,

I'm new to matplotlib, and I would like to create a typical plot of a
timecourse (markers connected by lines), with the markers varying in size
and/or style according to a separate set of data that corresponds to each
timepoint. However, my understanding is that plot() will not accept an array
of marker sizes, only a single float value that is applied to all markers.
On the other hand, scatter() does allow variably-sized markers (as in the
scatter_demo2.py example). However, there does not seem to be a
straightforward way to add lines to this plot connecting markers in
sequence. Can anyone recommend a work-around to this issue, or point out if
I've missed something in the documentation?

Thanks,
Tim
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Import matplotlib.pyplot fails on windows XP

2010-07-26 Thread eck naysmith



From: ben.r...@ou.edu
Date: Mon, 26 Jul 2010 09:56:27 -0500
Subject: Re: [Matplotlib-users] Import matplotlib.pyplot fails on windows XP
To: ecker...@hotmail.com
CC: matplotlib-users@lists.sourceforge.net

On Sat, Jul 24, 2010 at 4:57 AM, eck naysmith ecker...@hotmail.com wrote:







Hello,

I've installed the following Python packages on a Windows XP machine:

Python 2.6.5

Python 2.6 numpy-1.4.1

Python 2.6 matplotlib-0.99.3 [installer - matplotlib-0.99.3.win32-py2.6]



Python and Numpy work correctly. Matplotlib also works and as a test I tried 
successfully the following on the python interpretor:

from matplotlib.pyplot import *
plot([1,2,3])
show()

A graph then appears and thus so far so good.



However, when I try to run a certain python script, a problem occurs when 
importing from matplotlib:









Traceback (most recent
call last):
  File
C:\Pythoncode\Games\Bridge_war_2\unitload2.py, line 2, in
module
from matplotlib.pyplot
import plot, ylabel,xlabel, show
  File
C:\Python26\lib\site-packages\matplotlib\pyplot.py, line
78, in module
new_figure_manager,
draw_if_interactive, show = pylab_setup()
  File
C:\Python26\lib\site-packages\matplotlib\backends\__init__.py,
line 25, in pylab_setup
globals(),locals(),[backend_name])
  File
C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py,
line 7, in module
import Tkinter as Tk,
FileDialog
  File
C:\Python26\lib\lib-tk\FileDialog.py, line 12, in
module
from Dialog import
Dialog
  File
C:\Pythoncode\Games\Bridge_war_2\Dialog.py, line 2, in
module
import  wx
ImportError: No module
named wx

The error is that your Windows XP box does not have the wxPython module 
installed for Windows.

http://www.wxpython.org/download.php



I hope that helps,

Ben Root


No calls are made anywhere for wxPython so I don't know why it is seeking it. 
But when I installed wxPython anyway just to see what would happen, the 
traceback then ends at the penultimate line shown above i.e 

File
C:\Python26\lib\lib-tk\FileDialog.py, line 12, in
module
from Dialog import
Dialog
On the Traceback, each line beggining with 'File C:\Python26... is a 
seperate error. The most significant error is the first one:
'Traceback (most recent
call last):
  File
C:\Pythoncode\Games\Bridge_war_2\unitload2.py, line 2, in
module
from matplotlib.pyplot
import plot, ylabel,xlabel, show'
I suspected the problems were arising from the use of the statement 'from numpy 
import foobar' overwriting some of the names used by matplotlib, so I changed 
the import statement to 'import numpy' to avoid any potential namespace clash 
and adjusted the code accordingly. This does nothing and the exact same 
Traceback error messages occur.
Regards

Alex



  
_
http://clk.atdmt.com/UKM/go/195013117/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] rotating 3d axis

2010-07-26 Thread Mathew Yeates
Hi
Is there any way to let the user rotate a 3D plot? I don't see an
example which does this.

-Mathew

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] rotating 3d axis

2010-07-26 Thread Benjamin Root
On Mon, Jul 26, 2010 at 2:50 PM, Mathew Yeates mat.yea...@gmail.com wrote:

 Hi
 Is there any way to let the user rotate a 3D plot? I don't see an
 example which does this.

 -Mathew


What do you mean?  By default, all 3D plots are rotatable by merely clicking
and draging the plot around.  Or are you referring to how to set camera view
points?

Ben Root
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Plotting with varied marker sizes, or a scatter with connecting lines?

2010-07-26 Thread João Luís Silva

On 07/26/2010 08:18 PM, Timothy Vickery wrote:

Hi everyone,

I'm new to matplotlib, and I would like to create a typical plot of a
timecourse (markers connected by lines), with the markers varying in
size and/or style according to a separate set of data that corresponds
to each timepoint. However, my understanding is that plot() will not
accept an array of marker sizes, only a single float value that is
applied to all markers. On the other hand, scatter() does allow
variably-sized markers (as in the scatter_demo2.py example). However,
there does not seem to be a straightforward way to add lines to this
plot connecting markers in sequence. Can anyone recommend a work-around
to this issue, or point out if I've missed something in the documentation?

Thanks,
Tim



You could use plot and scatter on the same plot. See the attached example.

#---

import numpy as np
import matplotlib.pyplot as plt

N = 100
x = np.linspace(-10.0,10.0,N)
y  = 50.0*np.exp(-x**2)
size = 100.0*np.abs(np.sin(x))
plt.plot(x,y)
plt.scatter(x,y,s=size)

plt.show()

#---


Regards,
João Luís


#!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt

N = 100
x = np.linspace(-10.0,10.0,N)
y  = 50.0*np.exp(-x**2)
size = 100.0*np.abs(np.sin(x))
plt.plot(x,y)
plt.scatter(x,y,s=size)

plt.show()
attachment: plot_and_scatter.png--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Documentation error/bug?

2010-07-26 Thread Benjamin Root
On Mon, Jul 26, 2010 at 9:49 AM, Benjamin Root ben.r...@ou.edu wrote:

 On Sat, Jul 24, 2010 at 1:51 PM, Josh Lawrence 
 josh.k.lawre...@gmail.comwrote:

  Hello,

 I looked on your website for the different line styles. In the
 documentation for matplotlib.lines.line2D.set_linestyle, the dashed
 linestyle is listed as '-' and not '--'. It it my understanding that
 dashed should be '--'. If I'm incorrect, sorry for the noise.

 Cheers,

 --
 Josh Lawrence
 Ph.D. Student
 Clemson University



 Looks like the formatter for the online documentation took the double-dash
 to mean a long line, much like how LaTeX does.  Anybody know how to make
 the double-dash appear as two distinct dashes?


 http://matplotlib.sourceforge.net/api/artist_api.html?highlight=set_linestyle#matplotlib.lines.Line2D.set_linestyle

 Ben Root


After some reading of sphinx documentation, it appears to be a bug with
sphinx (or actually, smartypants) because it should not be doing this sort
of interpretation within a docstring.  Anyway, supposedly the workaround is
to put double backticks around the part that needs to be treated literally:
``'--'``.  I tried this out and built the docs locally and it works... sort
of.  The text that is surrounded by double backticks are getting a different
background color.  This doesn't look great to me.  Maybe someone else has a
thought?

Ben Root
--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fit a plane to a set of xyz points

2010-07-26 Thread Mathew Yeates
Is there a simple function call for this? And finding the distance of
a point to the plane?

-Mathew

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Bypass keyboard navigation

2010-07-26 Thread David Mashburn
Hello!

My name is David Mashburn, and I have been a very happy user of
matplotlib for almost 5 years now, so let me start by saying thank you
for this wonderful piece of software!  I has been a blessing to me!

I am creating a program that performs actions based on key commands in
matplotlib, and I keep bumping into conflicts with the interactive
keyboard navigation system.  Is there any way to bypass or disable some
or all of the keybindings hooked to interactive navigation?

By the way, I'm using the WxAgg backend if that matters.

Thanks!
-David


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Import matplotlib.pyplot fails on windows XP

2010-07-26 Thread eck naysmith

Problem solved.

When I set up python on the Windows machine, I simply copied over the 
directories and everything in them from my Linux machine, including all of the 
python bytecode *.pyc files. Trying to run a script with those *.pyc files 
present was causing the problem as they were compiled on my Linux machine 
originally. 

The matplotlib call works fine when I move the scripts to a clean folder.

Thanks

Alex 

From: ben.r...@ou.edu
Date: Mon, 26 Jul 2010 09:56:27 -0500
Subject: Re: [Matplotlib-users] Import matplotlib.pyplot fails on windows XP
To: ecker...@hotmail.com
CC: matplotlib-users@lists.sourceforge.net

On Sat, Jul 24, 2010 at 4:57 AM, eck naysmith ecker...@hotmail.com wrote:







Hello,

I've installed the following Python packages on a Windows XP machine:

Python 2.6.5

Python 2.6 numpy-1.4.1

Python 2.6 matplotlib-0.99.3 [installer - matplotlib-0.99.3.win32-py2.6]



Python and Numpy work correctly. Matplotlib also works and as a test I tried 
successfully the following on the python interpretor:

from matplotlib.pyplot import *
plot([1,2,3])
show()

A graph then appears and thus so far so good.



However, when I try to run a certain python script, a problem occurs when 
importing from matplotlib:









Traceback (most recent
call last):
  File
C:\Pythoncode\Games\Bridge_war_2\unitload2.py, line 2, in
module
from matplotlib.pyplot
import plot, ylabel,xlabel, show
  File
C:\Python26\lib\site-packages\matplotlib\pyplot.py, line
78, in module
new_figure_manager,
draw_if_interactive, show = pylab_setup()
  File
C:\Python26\lib\site-packages\matplotlib\backends\__init__.py,
line 25, in pylab_setup
globals(),locals(),[backend_name])
  File
C:\Python26\lib\site-packages\matplotlib\backends\backend_tkagg.py,
line 7, in module
import Tkinter as Tk,
FileDialog
  File
C:\Python26\lib\lib-tk\FileDialog.py, line 12, in
module
from Dialog import
Dialog
  File
C:\Pythoncode\Games\Bridge_war_2\Dialog.py, line 2, in
module
import  wx
ImportError: No module
named wx

The error is that your Windows XP box does not have the wxPython module 
installed for Windows.

http://www.wxpython.org/download.php



I hope that helps,

Ben Root
  
_
http://clk.atdmt.com/UKM/go/19780/direct/01/
We want to hear all your funny, exciting and crazy Hotmail stories. Tell us now--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Contour plots with same color mapping

2010-07-26 Thread Nikolaus Rath
Hello,

I would like to draw a couple of contour plots. The plots are on
separate figures, but they should all have exactly the same color
mapping (i.e, the same Z value should correspond to the same color in
all plots).

What's the best way to achieve this?

From the documentation I gather that I should use the norm and extend
keyword arguments, but I wasn't really able to figure out what values
I have to pass and how the matplotlib.colors.Normalize instance works.


Thanks,

   -Nikolaus

-- 
 »Time flies like an arrow, fruit flies like a Banana.«

  PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6  02CF A9AD B7F8 AE4E 425C

--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bypass keyboard navigation

2010-07-26 Thread Eric Firing
On 07/26/2010 10:18 AM, Benjamin Root wrote:
 On Mon, Jul 26, 2010 at 3:09 PM, David Mashburn
 david.n.mashb...@gmail.com mailto:david.n.mashb...@gmail.com wrote:

 Hello!

 My name is David Mashburn, and I have been a very happy user of
 matplotlib for almost 5 years now, so let me start by saying thank you
 for this wonderful piece of software!  I has been a blessing to me!

 I am creating a program that performs actions based on key commands in
 matplotlib, and I keep bumping into conflicts with the interactive
 keyboard navigation system.  Is there any way to bypass or disable some
 or all of the keybindings hooked to interactive navigation?

 By the way, I'm using the WxAgg backend if that matters.

 Thanks!
 -David


 David,

 I have not tested this myself, but I believe that if you set
 navigate=False as a keyword argument for making your axes, this will
 stop the callbacks from being registered.

That completely disables the toolbar, which is likely not what the OP wants.

There are a bunch of rcParams, listed at the bottom of 
matplotlibrc_template (and of the default matplotlibrc file that is 
installed) that can be used to turn off the key bindings without 
disabling the toolbar.

Personally, I think that putting in all those key bindings by default 
was a major mistake, one that should be reversed ASAP.  Having the plot 
jump to fullscreen when one bumps f is rude. The first time it 
happened I had no idea what was going on or how to recover from it--I 
thought maybe my X-server had gone bonkers. And does one actually save a 
displayed figure so often that it is useful to have the s shortcut to 
save one from having to click the toolbar button?  I could go on with 
this complaint...

Eric


 Thanks for using matplotlib!

 Ben Root


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Contour plots with same color mapping

2010-07-26 Thread Eric Firing
On 07/26/2010 10:13 AM, Nikolaus Rath wrote:
 Hello,

 I would like to draw a couple of contour plots. The plots are on
 separate figures, but they should all have exactly the same color
 mapping (i.e, the same Z value should correspond to the same color in
 all plots).

 What's the best way to achieve this?

I think that all you will need is to specify the same cmap (if you are 
not using the default) and contour levels for both plots.  You should 
not need to use the norm, unless you are doing something fancy; and in 
that case, all you need to do is specify the same norm for both plots. 
The real key, though, is explicitly specifying the set of contour levels 
that you want, and using the same one for both plots.

e.g.:

from pylab import * # yes, this is not recommended...
clevs = arange(0.3, 0.701, 0.1)
fig1 = figure()
contourf(rand(20,20), levels=clevs, extend='both')
colorbar()
fig2 = figure()
contourf(rand(30,40), levels=clevs, extend='both')
colorbar()
show()



You need to use the extend argument only if you want values beyond the 
levels you specify to constitute open-ended ranges.  For example, if you 
have data values from 0 to 10, but most are between 4 and 6, you could 
specify levels as numpy.arange(4, 6.01, 0.1) and use extend='both'. Then 
all values greater than 6 would get a color at one end, and all values 
less than 4 would get another color at the other end.  If you use a 
colorbar, it will see the extend argument that was used in contourf, and 
draw the colorbar with pointed ends to indicate anything over and 
anything under.  As illustrated above.

Eric


  From the documentation I gather that I should use the norm and extend
 keyword arguments, but I wasn't really able to figure out what values
 I have to pass and how the matplotlib.colors.Normalize instance works.


 Thanks,

 -Nikolaus



--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bypass keyboard navigation

2010-07-26 Thread David Mashburn
Ben and Eric,

Thanks so much for your help!

I'm trying to turn change some of the rcParams in my script... Here is a 
test of what happens:

import matplotlib
matplotlib.rcParams['keymap.fullscreen']=''

Traceback (most recent call last):
  File input, line 1, in module
  File /usr/lib/pymodules/python2.6/matplotlib/__init__.py, line 623, 
in __setitem__
See rcParams.keys() for a list of valid parameters.'%key)
KeyError: 'keymap.fullscreen is not a valid rc parameter.See 
rcParams.keys() for a list of valid parameters.'

It seems that none of the keymap parameters are defined in my rcParams 
dictionary...

I also tried adding some of the keymap lines out of the online rc file:
http://matplotlib.sf.net/_static/matplotlibrc
to my rc file and it told me:   Bad key keymap.pan

I've got version 0.99.0 on ubuntu.

Is this a new feature?  Do you know what I can try instead??

Thanks!
-David

On 07/26/2010 10:18 AM, Benjamin Root wrote:
 On Mon, Jul 26, 2010 at 3:09 PM, David Mashburn
 david.n.mashb...@gmail.com mailto:david.n.mashb...@gmail.com 
 mailto:david.n.mashb...@gmail.com mailto:david.n.mashb...@gmail.com 
 wrote:

 Hello!

 My name is David Mashburn, and I have been a very happy user of
 matplotlib for almost 5 years now, so let me start by saying thank you
 for this wonderful piece of software!  I has been a blessing to me!

 I am creating a program that performs actions based on key commands in
 matplotlib, and I keep bumping into conflicts with the interactive
 keyboard navigation system.  Is there any way to bypass or disable some
 or all of the keybindings hooked to interactive navigation?

 By the way, I'm using the WxAgg backend if that matters.

 Thanks!
 -David


 David,

 I have not tested this myself, but I believe that if you set
 navigate=False as a keyword argument for making your axes, this will
 stop the callbacks from being registered.

That completely disables the toolbar, which is likely not what the OP wants.

There are a bunch of rcParams, listed at the bottom of 
matplotlibrc_template (and of the default matplotlibrc file that is 
installed) that can be used to turn off the key bindings without 
disabling the toolbar.

Personally, I think that putting in all those key bindings by default 
was a major mistake, one that should be reversed ASAP.  Having the plot 
jump to fullscreen when one bumps f is rude. The first time it 
happened I had no idea what was going on or how to recover from it--I 
thought maybe my X-server had gone bonkers. And does one actually save a 
displayed figure so often that it is useful to have the s shortcut to 
save one from having to click the toolbar button?  I could go on with 
this complaint...

Eric


 Thanks for using matplotlib!

 Ben Root




--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Bypass keyboard navigation

2010-07-26 Thread Eric Firing
On 07/26/2010 12:17 PM, David Mashburn wrote:
 Ben and Eric,

 Thanks so much for your help!

 I'm trying to turn change some of the rcParams in my script... Here is a
 test of what happens:

 import matplotlib
 matplotlib.rcParams['keymap.fullscreen']=''

 Traceback (most recent call last):
File input, line 1, inmodule
File /usr/lib/pymodules/python2.6/matplotlib/__init__.py, line 623,
 in __setitem__
  See rcParams.keys() for a list of valid parameters.'%key)
 KeyError: 'keymap.fullscreen is not a valid rc parameter.See
 rcParams.keys() for a list of valid parameters.'

 It seems that none of the keymap parameters are defined in my rcParams
 dictionary...

 I also tried adding some of the keymap lines out of the online rc file:
 http://matplotlib.sf.net/_static/matplotlibrc
 to my rc file and it told me:   Bad key keymap.pan

 I've got version 0.99.0 on ubuntu.

Aha!  I thought you were using 1.0.  For 1.0, these things are rc 
settings; I had no idea they even existed back in 0.99.0.  I only 
tripped over f very recently.

The key bindings are coded in the key_press() method of 
FigureManagerBase.  The callback is connected to the canvas in the 
__init__ method.  The trick is to disconnect the callback:

fig = figure()
fig.canvas.mpl_disconnect(3)
plot([1,2,3])

Now key presses have no effect in that figure.  The bad thing here is 
that I used the cid 3, a seemingly random number.  I suspect, though, 
that once you find out what it is in your version of mpl (and it may 
still be 3), you will be able to rely on it for your purposes.  To find 
it, print out fig.canvas.callbacks.callbacks and look for 
key_press_event.  You could have your program use this dictionary to 
look it up.


Eric

 Is this a new feature?  Do you know what I can try instead??

 Thanks!
 -David

 On 07/26/2010 10:18 AM, Benjamin Root wrote:
 On Mon, Jul 26, 2010 at 3:09 PM, David Mashburn
 david.n.mashb...@gmail.commailto:david.n.mashb...@gmail.com  
 mailto:david.n.mashb...@gmail.commailto:david.n.mashb...@gmail.com  
 wrote:

  Hello!

  My name is David Mashburn, and I have been a very happy user of
  matplotlib for almost 5 years now, so let me start by saying thank you
  for this wonderful piece of software!  I has been a blessing to me!

  I am creating a program that performs actions based on key commands in
  matplotlib, and I keep bumping into conflicts with the interactive
  keyboard navigation system.  Is there any way to bypass or disable some
  or all of the keybindings hooked to interactive navigation?

  By the way, I'm using the WxAgg backend if that matters.

  Thanks!
  -David


 David,

 I have not tested this myself, but I believe that if you set
 navigate=False as a keyword argument for making your axes, this will
 stop the callbacks from being registered.

 That completely disables the toolbar, which is likely not what the OP wants.

 There are a bunch of rcParams, listed at the bottom of
 matplotlibrc_template (and of the default matplotlibrc file that is
 installed) that can be used to turn off the key bindings without
 disabling the toolbar.

 Personally, I think that putting in all those key bindings by default
 was a major mistake, one that should be reversed ASAP.  Having the plot
 jump to fullscreen when one bumps f is rude. The first time it
 happened I had no idea what was going on or how to recover from it--I
 thought maybe my X-server had gone bonkers. And does one actually save a
 displayed figure so often that it is useful to have the s shortcut to
 save one from having to click the toolbar button?  I could go on with
 this complaint...

 Eric


 Thanks for using matplotlib!

 Ben Root




 --
 The Palm PDK Hot Apps Program offers developers who use the
 Plug-In Development Kit to bring their C/C++ apps to Palm for a share
 of $1 Million in cash or HP Products. Visit us here for more details:
 http://ad.doubleclick.net/clk;226879339;13503038;l?
 http://clk.atdmt.com/CRS/go/247765532/direct/01/
 ___
 Matplotlib-users mailing list
 Matplotlib-users@lists.sourceforge.net
 https://lists.sourceforge.net/lists/listinfo/matplotlib-users


--
The Palm PDK Hot Apps Program offers developers who use the
Plug-In Development Kit to bring their C/C++ apps to Palm for a share 
of $1 Million in cash or HP Products. Visit us here for more details:
http://ad.doubleclick.net/clk;226879339;13503038;l?
http://clk.atdmt.com/CRS/go/247765532/direct/01/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users