Re: [Matplotlib-users] Problem with the position of tick la bels in postscript file

2007-05-04 Thread Zack
Hi Richard, what exactly wrong here?
I didn't found anything...

On 4 May 2007, Richard Vernhes wrote:
> Here is attached the eps file with misaligned labels and grid.
> Richard



-- 
Zack

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] wx printing and py2exe examples don't work on py25 wx2.8.3

2007-05-04 Thread Gustavo Borges

Im developing a financial python/wx/sqlite and the client requested me a
chart. I first thought about using win32com to call excel but didnt sound so
clean to me. I googled a little and found matplot. Seems really great even
becouse it could be embedded on WX applications. But since im out of time i
just used the simplest example without embedding anything:

from pylab import *
class VButler(wx.Frame):
 (...)
def first_chart (self,ticks):
   display = self.load_indicatorVol(ticks)
   colors=['ro','bo','go','yo','rs','bs','gs','ys']
   for row in display:
  try:
   cor=colors.pop(0)
  except:
   colors=['rx','bx','gx','yx','rv','bv','gv','yv']
   cor=colors.pop(0)
  plot([float(row[2])],[float(row[3])],cor)
  text(float(row[2]),float(row[3]),row[0])
   axis([0,10,0,25])
   show()

When i tryed to print using printing_in_wx.py i couldnt. It would only print
a part of the graphic, if i tryed to preview the print it would show me a
blank page. Ctrl+c had a problem since event.KeyCode is not a function and
was called like one, but fixed that it would copy the image to clipboard OK.

My boss is requesting me this software as soon as yesterday so i gave him
the option of first saving it as a PNG and then print... When i tryed to
build a py2exe i got some problems...
# My Setup Code
VolatilityButler = Target(
   # used for the versioninfo resource
   description = "VolatilityButler",
   version = "1.2.1",
   company_name = "Sala 1 / La Colina",
   name = "VolatilityButler",

   # what to build
   script = "vol_butler.py",
   other_resources = [(RT_MANIFEST, 1, manifest_template %
dict(prog="VolatilityButler")),],
   icon_resources = [(1, "butler.ico")],
   dest_base = "VolatilityButler")
setup(
   options = {"py2exe": {"compressed": 1,
 "optimize": 2,
 "ascii": 1,
 "bundle_files": 1}},
   zipfile = None,
   windows = [VolatilityButler],
   )

#Error after running it
The following modules appear to be missing
['FFT', 'LinearAlgebra', 'MA', 'MLab', 'Matrix', 'Numeric', 'Pyrex', '
Pyrex.Compiler', '_curses', 'backends.draw_if_interactive','
backends.new_figure_manager',]

it was alot of modules not found and when i tryed to run the exe

Traceback (most recent call last):
 File "vol_butler.py", line 14, in 
   from pylab import *
 File "zipextimporter.pyo", line 82, in load_module
 File "pylab.pyo", line 1, in 
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\pylab.pyo", line 199, in 
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\cm.pyo", line 5, in 
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\colors.pyo", line 33, in 
 File "zipextimporter.pyo", line 82, in load_module
 File "matplotlib\numerix\__init__.pyo", line 147, in 
ImportError: No module named random_array

i looked at some setup.py examples, but they are from python 2.3 and using a
'share' folder that i dont have in my Python2.5 folder. But i tryed to make
it like the example.
data = glob.glob('C:\Python25\Lib\site-packages\matplotlib\*')
setup(
   options = {"py2exe": {"compressed": 1,
 "optimize": 2,
 "ascii": 1,
 "bundle_files": 1}},
   zipfile = None,
   windows = [VolatilityButler],
   data_files=[("matplotlibdata",data)],
   )


and the error while running the setup:
*** copy data files ***
error: can't copy 'C:\Python25\Lib\site-packages\matplotlib\backends':
doesn't exist or not a regular file
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting wind-speed time series (was: What kind of chart should I use?)

2007-05-04 Thread John Hunter
On 5/4/07, Alan Jackson <[EMAIL PROTECTED]> wrote:
> On Fri, 4 May 2007 12:15:13 -0700 (PDT)
> [EMAIL PROTECTED] wrote:
>
> > Saw this:
> >
> > http://www.originlab.com/www/products/GraphGallery.aspx?GID=26&s=8&lm=215
> >
> > Since I am not interested in wind direction, may be I can use stacked 
> > bar-chart.   Still, how would I tie plot_data with it though?


grab "windrose.py" at the end of this thread

http://www.nabble.com/windrose-t1392107.html

I've not used it but I think it is what you are looking for: a
windrose module for python.

JDH

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting wind-speed time series (was: What kind of chart should I use?)

2007-05-04 Thread Alan Jackson
On Fri, 4 May 2007 12:15:13 -0700 (PDT)
[EMAIL PROTECTED] wrote:

> Saw this:
> 
> http://www.originlab.com/www/products/GraphGallery.aspx?GID=26&s=8&lm=215
> 
> Since I am not interested in wind direction, may be I can use stacked 
> bar-chart.   Still, how would I tie plot_data with it though?

I don't do what you are trying to do, but I do some other weather plots,
http://www.oplnk.net/~ajackson/weather/


-- 
---
| Alan K. Jackson| To see a World in a Grain of Sand  |
| [EMAIL PROTECTED]  | And a Heaven in a Wild Flower, |
| www.ajackson.org   | Hold Infinity in the palm of your hand |
| Houston, Texas | And Eternity in an hour. - Blake   |
---

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plotting wind-speed time series (was: What kind of chart should I use?)

2007-05-04 Thread kc106_2005-matplotlib
Saw this:

http://www.originlab.com/www/products/GraphGallery.aspx?GID=26&s=8&lm=215

Since I am not interested in wind direction, may be I can use stacked 
bar-chart.   Still, how would I tie plot_data with it though?

Regards,

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On 
> Behalf Of [EMAIL PROTECTED]
> Sent: Friday, May 04, 2007 9:41 AM
> To: matplotlib-users@lists.sourceforge.net
> Subject: [Matplotlib-users] What kind of chart should I use?
> 
> 
> Hi list,
> 
> I have a set of time series data which is year's worth of 
> wind speed at a particular place (one data point per minute). 
>  I want to see how wind speed spreads throughout the day.   I 
> can do a scatter char with 24 hours of the day vs wind speed 
> but then I end up with something that's not too useful (too 
> many data points).  What's more interesting is to present the 
> data as a time / wind speed / frequency plot.
> 
> The kind of plot shown in image_interp.py looks interesting.  
>  Is there a way to combine the capability of plot_date and 
> imshow?   If so, may be I can have hour of the day vs 
> wind-speed with the color be a function of the data frequency. 
> 
> Thanks,
>  
> --
> John Henry
> 
 
--
John Henry



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Robert Kern wrote:
> Christopher Barker wrote:
>> Samuel M. Smith wrote:
>>> I did not have this problem with the matplotlib on
>>> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5-macosx10.4-2007-02-20.dmg
>> That one was probably built with a statically linked freetype, as the 
>> one Apple provides doesn't work with MPL.
> 
> No, it was built against a dynamic freetype library which was not included 
> with
> the package. If it had been statically linked, there wouldn't be a problem.

My deepest apologies. I misread your post as referring to the Scipy Superpack
package. You are correct.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Samuel M. Smith wrote:
> So the conclusion is pythonmac matplotlib uses a statically linked  
> freetype so it doesn't look into /usr/local/lib
> and Fonnesbeck's scipy superpack matplotlib is using a dynamically  
> linked freetype which is looking into /usr/local/lib

Yes.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Samuel M. Smith
So the conclusion is pythonmac matplotlib uses a statically linked  
freetype so it doesn't look into /usr/local/lib
and Fonnesbeck's scipy superpack matplotlib is using a dynamically  
linked freetype which is looking into /usr/local/lib


On 4 May 2007, at 12:09 , Robert Kern wrote:

> Christopher Barker wrote:
>> Samuel M. Smith wrote:
>>> I did not have this problem with the matplotlib on
>>> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0- 
>>> py2.5-macosx10.4-2007-02-20.dmg
>>
>> That one was probably built with a statically linked freetype, as the
>> one Apple provides doesn't work with MPL.
>
> No, it was built against a dynamic freetype library which was not  
> included with
> the package. If it had been statically linked, there wouldn't be a  
> problem.
>
> -- 
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a  
> harmless enigma
>  that is made terrible by our own mad attempt to interpret it as  
> though it had
>  an underlying truth."
>   -- Umberto Eco
>
>
> -- 
> ---
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users

**
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84005-4108
801-768-2768 voice
801-768-2769 fax
**
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Robert Kern
Christopher Barker wrote:
> Samuel M. Smith wrote:
>> I did not have this problem with the matplotlib on
>> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5-macosx10.4-2007-02-20.dmg
> 
> That one was probably built with a statically linked freetype, as the 
> one Apple provides doesn't work with MPL.

No, it was built against a dynamic freetype library which was not included with
the package. If it had been statically linked, there wouldn't be a problem.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Christopher Barker
Samuel M. Smith wrote:
> I did not have this problem with the matplotlib on
> http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5-macosx10.4-2007-02-20.dmg


That one was probably built with a statically linked freetype, as the 
one Apple provides doesn't work with MPL.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] What kind of chart should I use?

2007-05-04 Thread Christopher Barker
It sounds like you want a 2-d histogram: i.e. bins for each time and
speed-range combination.

I'm not sure how to plot that as a 3-d plot, but contouring it might
work OK.

-Chris

-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with the position of tick labels in postscript file

2007-05-04 Thread Christopher Barker
Darren Dale wrote:
> Maybe you could post your file? Mine looks ok, see attached.

A close look at that attached file shows that the grid lines are not 
quite lined up with the tics -- by about a line width.

I suspect that the grid code and tic code are rounding differently or 
something.

-Chris


-- 
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R(206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] freetypelib problem scipy superpack matplotlib

2007-05-04 Thread Samuel M. Smith
I needed to use some function from scipy. It appeared that the  
easiest way to install it was to use the scipy superpack

http://idisk.mac.com/fonnesbeck-Public/ScipySuperpack-PPC-10.4-py2.5.zip

After installing ipython --pylab exits with error on startup see below:
It appears to be a freetype problem.  I have the macports freetype in
/opt/local/lib/libfreetype.6.dylib
I added a symbolic link in /usr/local/lib to the /opt/local/lib and  
that fixed the problem
sudo ln -s /opt/local/lib/libfreetype.6.dylib /usr/local/lib/ 
libfreetype.6.dylib


Since I did not have this problem with the matplotlib on
http://pythonmac.org/packages/py25-fat/dmg/matplotlib-0.90.0-py2.5- 
macosx10.4-2007-02-20.dmg


I wonder why this occurred with scypy super pack? I assume there is a  
difference in how the two were built

where one could find the free typelib and the other couldn't


ipython --pylab
loaded rc file /Users/samuel/.matplotlib/matplotlibrc
matplotlib version 0.90.0
verbose.level helpful
interactive is False
units is False
platform is darwin
numerix numpy 1.0.3.dev3728
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/Current/bin/ 
ipython", line 27, in 

IPython.Shell.start().mainloop()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/Shell.py", line , in start

return shell(user_ns = user_ns)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/Shell.py", line 1028, in __init__

shell_class=MatplotlibMTShell)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/Shell.py", line 767, in __init__

on_kill=[self.wxexit])
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/ipmaker.py", line 95, in make_IPython

embedded=embedded,**kw)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/Shell.py", line 571, in __init__

user_ns,b2 = self._matplotlib_config(name,user_ns)
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/IPython/Shell.py", line 463, in  
_matplotlib_config

from matplotlib import backends
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/backends/__init__.py", line 55, in  


new_figure_manager, draw_if_interactive, show = pylab_setup()
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/backends/__init__.py", line 24, in  
pylab_setup

globals(),locals(),[backend_name])
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/backends/backend_wxagg.py", line  
21, in 

from matplotlib.figure import Figure
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/figure.py", line 7, in 

from axes import Axes, Subplot, PolarSubplot, PolarAxes
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/axes.py", line 17, in 

from axis import XAxis, YAxis
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/axis.py", line 25, in 

from font_manager import FontProperties
  File "/Library/Frameworks/Python.framework/Versions/2.5/lib/ 
python2.5/site-packages/matplotlib/font_manager.py", line 39, in  


from matplotlib import ft2font
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2.5/site-packages/matplotlib/ft2font.so, 2): Library not  
loaded: /usr/local/lib/libfreetype.6.dylib
  Referenced from: /Library/Frameworks/Python.framework/Versions/2.5/ 
lib/python2.5/site-packages/matplotlib/ft2font.so

  Reason: image not found




**
Samuel M. Smith Ph.D.
2966 Fort Hill Road
Eagle Mountain, Utah 84005-4108
801-768-2768 voice
801-768-2769 fax
**
"The greatest source of failure and unhappiness in the world is
giving up what we want most for what we want at the moment"
**


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] What kind of chart should I use?

2007-05-04 Thread kc106_2005-matplotlib
Hi list,

I have a set of time series data which is year's worth of wind speed at a 
particular place (one data point per minute).  I want to see how wind speed 
spreads throughout the day.   I can do a scatter char with 24 hours of the day 
vs wind speed but then I end up with something that's not too useful (too many 
data points).  What's more interesting is to present the data as a time / wind 
speed / frequency plot.

The kind of plot shown in image_interp.py looks interesting.   Is there a way 
to combine the capability of plot_date and imshow?   If so, may be I can have 
hour of the day vs wind-speed with the color be a function of the data 
frequency. 

Thanks,
 
--
John Henry



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem with the position of tick labels in postscript file

2007-05-04 Thread Darren Dale
On Friday 04 May 2007 11:10:32 am Richard Vernhes wrote:
> Hi to all,
> I'm new to Matplotlib and I noticed a problem concerning the placement of
> tick labels when saving a figure to a postscript file. I'm using windows XP
> with Matplotlib 0.90.0 and the default setup and backend. I also use
> ipython with the -pylab option.
> So, I type plot((1,2,3)) in the shell and I get a figure similar to that
> presented in the user guide. Then I save it as an eps file and when I open
> the resulting file (using GSVIEW) I notice that the labels on the y axis
> are not properly aligned. That is, the 1.5 and 2.5 labels are almost stuck
> to the y axis, while the 1.0, 2.0 and 3.0 labels are farther. Furthermore,
> when I add a grid to my plot and save it to eps, I notice that the grid
> lines are not well aligned with the ticks. This problem seems to occur both
> with ps, eps and pdf files. Does anybody know what's the problem here?

Maybe you could post your file? Mine looks ok, see attached.
<>-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] From list of objects to plotting

2007-05-04 Thread Tommy Grav
I have some code that simplified looks like this:

class cKBO(object):
def __init__(cls):
cls.a = 0.
cls.e = 0.

lines = open("test.file","r").readlines()

nlist = []
for line in lines:
obj = cKBO()
(a,e) = line.split
obj.a = float(a)
obj.e = float(e)
nlist.append(obj)

I would now like to plot a vs e for all the obj objects in nlist.
how do I do that? I tried

plot(nlist[:].a,nlist[:].e,'ko')
show()

but that resulted in
raceback (most recent call last):
   File "/Users/tgrav/Work/MyCode/Python/MOPS/ckbos.py", line 108, in ?
 plot(nlist[:].a,nlist[:].e,'ko')
AttributeError: 'list' object has no attribute 'a'

Which is understandable. But how do I most easily convert a list of  
class
objects into two lists of object variables?

Cheers
   Tommy



-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] build error on solaris

2007-05-04 Thread Daniel Fan
Hi Nadia,

Actually, I have successfully install matplotlib by
being patient.
I used
CC=CC python setup.py build
first and when it stops for the compilation of a .c
file, I switch to
CC=cc python setup.py build
and let it run and switches again when it stops.
Probably changing the
Makefile as you say is a better way.

Now I have an import error though. I definitely have
numpy installed and
numpy.test() show all tests passed.

>>> import matplotlib
>>> import pylab

The import of the numpy version of the _transforms
module,
_ns_transforms, failed. This is is either because
numpy was
unavailable when matplotlib was compiled, because a
dependency of
_ns_transforms could not be satisfied, or because the
build flag for
this module was turned off in setup.py. If it appears
that
_ns_transforms was not built, make sure you have a
working copy of
numpy and then re-install matplotlib. Otherwise, the
following
traceback gives more details:

Traceback (most recent call last):
File "", line 1, in 
File
"/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/pylab.py",
line 203, in 
from axes import Axes, PolarAxes
File
"/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/axes.py",
line 14, in 
import artist
File
"/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/artist.py",
line 4, in 
from transforms import identity_transform
File
"/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/transforms.py",
line 223, in 
from _transforms import Value, Point, Interval, Bbox,
Affine
File
"/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/_transforms.py",
line 17, in 
from matplotlib._ns_transforms import *
ImportError: ld.so.1: python: fatal: relocation error:
file
/home/yfan/usr/local/share/ASpy25/lib/python2.5/site-packages/matplotlib/_ns_transforms.so:
symbol __1cDstdMdomain_error2T6M_v_: referenced symbol
not found


Nadia Dencheva wrote:
> Hi Daniel,
>
> I've seen that and the only way I can make Python
pick up the right
> compiler/linker is to modify
python/config/Makefile,
> specifically
> the fields for CC and CXX
>
> CC = gcc
> CXX = g  
>
> but also on some occasions comment out pic32
>
> CCSHARED= #-xcode=pic32
>
> It is possible that the compilation of ctraits.c
will fail because it
> doesn't compile with g   and needs gcc in which case
you can run the
> command
> manually with gcc and continue building the rest of
the package.
>
> These are all the gory details of compiling
matplotlib on Solaris.
> It's possible but it's a pain, I wish someone has a
better solution
> for this. (May be Sun/Solaris will disappear before
that.)
>
> Nadia
>
>




__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Problem with the position of tick labels in postscript file

2007-05-04 Thread Richard Vernhes
Hi to all,
I'm new to Matplotlib and I noticed a problem concerning the placement of tick
labels when saving a figure to a postscript file. I'm using windows XP with
Matplotlib 0.90.0 and the default setup and backend. I also use ipython with
the -pylab option.
So, I type plot((1,2,3)) in the shell and I get a figure similar to that
presented in the user guide. Then I save it as an eps file and when I open the
resulting file (using GSVIEW) I notice that the labels on the y axis are not
properly aligned. That is, the 1.5 and 2.5 labels are almost stuck to the y
axis, while the 1.0, 2.0 and 3.0 labels are farther. Furthermore, when I add a
grid to my plot and save it to eps, I notice that the grid lines are not well
aligned with the ticks. This problem seems to occur both with ps, eps and pdf
files. Does anybody know what's the problem here?
Thank you

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] build error on solaris

2007-05-04 Thread Nadia Dencheva
Hi Daniel,

I've seen that and the only way I can make Python pick up the right
compiler/linker is to modify python/config/Makefile, specifically
the fields for CC and CXX

CC = gcc
CXX = g++

but also on some occasions comment out  pic32

CCSHARED=   #-xcode=pic32

It is possible that the compilation of ctraits.c will fail because it
doesn't compile with g++ and needs gcc in which case you can run the command
manually with gcc and continue building the rest of the package.

These are all the gory details of compiling matplotlib on Solaris.
It's possible but it's a pain, I wish someone has a better solution
for this. (May be Sun/Solaris will disappear before that.)

Nadia


Daniel Fan wrote:
> I think the problem is the building use the same
> command for compiling
> .c file and .cpp/.cxx file. It uses whatever I set to
> $CC to compile the
> file and ignore $CXX.
> I am using the latest ActivePython for solaris.
> I've tried to set $CC=g  , then I got the following
> error message:
> compute:/home/yfan/usr/local/src/matplotlib-0.87.7>
> CC=g   python
> setup.py build
> GTK requires pygtk
> GTKAgg requires pygtk
> running build
> running build_py
> running build_ext
> building 'matplotlib._agg' extension
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c src/agg.cxx -o
> build/temp.solaris-2.10-sun4u-2.5/src/agg.o
> g  : language code=pic32 not recognized
> g  : src/agg.cxx: linker input file unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_trans_affine.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_trans_affine.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_trans_affine.cpp: linker input file
> unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_path_storage.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_path_storage.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_path_storage.cpp: linker input file
> unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_bezier_arc.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_bezier_arc.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_bezier_arc.cpp: linker input file
> unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_vcgen_dash.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_vcgen_dash.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_vcgen_dash.cpp: linker input file
> unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_vcgen_stroke.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_vcgen_stroke.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_vcgen_stroke.cpp: linker input file
> unused since
> linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_rasterizer_scanline_aa.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_rasterizer_scanline_aa.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_rasterizer_scanline_aa.cpp: linker
> input file unused
> since linking not done
> g   -DNDEBUG -O -xcode=pic32 -Iagg23/include -Isrc
> -Iswig
> -I/home/yfan/usr/local/share/ASpy25/include/python2.5
> -c
> agg23/src/agg_curves.cpp -o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_curves.o
> g  : language code=pic32 not recognized
> g  : agg23/src/agg_curves.cpp: linker input file
> unused since linking
> not done
> CC -G build/temp.solaris-2.10-sun4u-2.5/src/agg.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_trans_affine.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_path_storage.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_bezier_arc.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_vcgen_dash.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_vcgen_stroke.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_rasterizer_scanline_aa.o
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_curves.o
> -lstdc   -lm -o
> build/lib.solaris-2.10-sun4u-2.5/matplotlib/_agg.so
> ld: fatal: file
> build/temp.solaris-2.10-sun4u-2.5/src/agg.o: open
> failed: No such file or directory
> ld: fatal: file
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_trans_affine.o:
> open
> failed: No such file or directory
> ld: fatal: file
> build/temp.solaris-2.10-sun4u-2.5/agg23/src/agg_path_storage.o:
> open
> failed: No such file or directory
> ld: fatal: file
> build/temp.solari