[Matplotlib-users] Error messages with xpdf / LaTeX

2009-02-23 Thread Paul Anton Letnes

Hi everyone,

I'm having issues using LaTeX text processing with the xpdf distiller.  
After playing with my settings, I finally managed to get vector  
graphics output using LaTeX test processing. However, a weird error  
message pops up in the terminal every time (mostly annoying, the  
plotting actually works):


Error: No paper information available - using defaults
Error: No display font for 'Courier'
Error: No display font for 'Courier-Bold'
Error: No display font for 'Courier-BoldOblique'
Error: No display font for 'Courier-Oblique'
Error: No display font for 'Helvetica'
Error: No display font for 'Helvetica-Bold'
Error: No display font for 'Helvetica-BoldOblique'
Error: No display font for 'Helvetica-Oblique'
Error: No display font for 'Symbol'
Error: No display font for 'Times-Bold'
Error: No display font for 'Times-BoldItalic'
Error: No display font for 'Times-Italic'
Error: No display font for 'Times-Roman'
Error: No display font for 'ZapfDingbats'

I attach my matplotlibrc file for reference. Note especially the stuff  
at the end with usetex=True and distiller = xpdf. If you know any  
other settings that might work better, please let me know! I suspect  
these settings are the sources of my annoying error messages.


Cheers,
Paul.




matplotlibrc
Description: Binary data




--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Adding custom axes within a subplot

2009-02-23 Thread Johann Rohwer
I'm trying to insert a custom set of axes within a subplot, much like 
the axes_demo.py. Only difference is, now I want an inset graph 
inside each of a number of subplots. Using ASCII art, much like the 
following:


|---|
|   |
|   |
|  -|
|  |   ||
|  -|
|---|

|---|
|   |
|   |
|  -|
|  |   ||
|  -|
|---|

Where the whole thing would be the figure, containing 2 subplots each 
with an inset.

Is there any way to have the rect coordinates of
fig.add_axes(rect)
to refer to the axes coordinates of the respective subplot, and not of 
the complete figure? (In reality there are actually 12 subplots, not 
only 2

Or is there another easy way to accomplish this?

Johann

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Backend problem

2009-02-23 Thread Nils Wagner
Hi all,

How can I resolve the following backend problem ?
What are the default library and include directories for 
tcl and tk ?
Where should I define DISPLAY in that context ?

python setup.py build --help

OPTIONAL BACKEND DEPENDENCIES
 libpng: 1.2.7
Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
 * Using default library and 
include directories for
 * Tcl and Tk because a Tk window 
failed to open.
 * You may need to define DISPLAY 
for Tk to work so
 * that setup can determine where 
your libraries are
 * located.


Any pointer would be appreciated.

  Nils
  

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error messages with xpdf / LaTeX

2009-02-23 Thread Darren Dale
On Mon, Feb 23, 2009 at 3:59 AM, Paul Anton Letnes <
paul.anton.let...@gmail.com> wrote:

> Hi everyone,
>
> I'm having issues using LaTeX text processing with the xpdf distiller.
> After playing with my settings, I finally managed to get vector graphics
> output using LaTeX test processing. However, a weird error message pops up
> in the terminal every time (mostly annoying, the plotting actually works):
>
> Error: No paper information available - using defaults
> Error: No display font for 'Courier'
> Error: No display font for 'Courier-Bold'
> Error: No display font for 'Courier-BoldOblique'
> Error: No display font for 'Courier-Oblique'
> Error: No display font for 'Helvetica'
> Error: No display font for 'Helvetica-Bold'
> Error: No display font for 'Helvetica-BoldOblique'
> Error: No display font for 'Helvetica-Oblique'
> Error: No display font for 'Symbol'
> Error: No display font for 'Times-Bold'
> Error: No display font for 'Times-BoldItalic'
> Error: No display font for 'Times-Italic'
> Error: No display font for 'Times-Roman'
> Error: No display font for 'ZapfDingbats'
>
> I attach my matplotlibrc file for reference. Note especially the stuff at
> the end with usetex=True and distiller = xpdf. If you know any other
> settings that might work better, please let me know! I suspect these
> settings are the sources of my annoying error messages.
>

Do you have the relevant latex font packages installed? Like psnfss? I
suspect this is an issue with your latex installation, not matplotlib.

Darren
--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Crash when trying to show a semilog or log-log plot

2009-02-23 Thread Michael Droettboom
Strange.  I am unable to reproduce this with 0.98.2 (0.98.3 or 0.98.5)...

It's happening inside of the math expression renderer, which is used to 
draw the exponents that happen with semilog and log-log axes.  It 
doesn't, however, appear to be font-related, which is a frequent 
installation/system problem.

What is strange about this traceback is that it is using the system-wide 
installed version of pyparsing.py, and not the one that comes with 
matplotlib.  matplotlib is very sensitive to small version changes in 
pyparsing, so we distribute our own copy and try to use it.  If you 
temporarily move /usr/lib/python2.4/site-packages/pyparsing.py to 
another location, does that solve the problem?  If so, I will look into 
how we're importing pyparsing.py to ensure we always use the local copy.

Mike

Craig Finch wrote:
> I am using matplotlib-0.98.5.2 and getting a strange crash when trying to 
> show() a window with semilog or log-log axes.  Here is a simple script that 
> will cause the crash:
>
> import pylab
> from numpy import *
> x = arange(1., 10., 0.1)
> y = x**2
> pylab.semilogx(x,y)
> pylab.show()
>
> At the end of this message is a sample of the output.  I had to cut it down 
> because it's apparently stuck in a loop in pyparsing.py and keeps outputting 
> the same repetitive message.  Did I find a bug here?  Any suggestions would 
> be appreciated.
>
>Craig
>
> Sample output:
> --
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 
> 352, in expose_event
> self._render_figure(self._pixmap, w, h)
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", 
> line 75, in _render_figure
> FigureCanvasAgg.draw(self)
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
> 279, in draw
> self.figure.draw(self.renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/figure.py", line 772, in 
> draw
> for a in self.axes: a.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1601, in 
> draw
> a.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in 
> draw
> tick.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in 
> draw
> self.label1.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 452, in 
> draw
> bbox, info = self._get_layout(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 252, in 
> _get_layout
> w, h, d = renderer.get_text_width_height_descent(
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
> 152, in get_text_width_height_descent
> ox, oy, width, height, descent, fonts, used_characters = \
>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 2808, 
> in parse
> box = self._parser.parse(s, font_output, fontsize, dpi)
>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 2259, 
> in parse
> self._expression.parseString(s)
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 1065, in 
> parseString
> loc, tokens = self._parse( instring, 0 )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( instring, preloc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 2577, in 
> parseImpl
> return self.expr._parse( instring, loc, doActions, callPreParse=False )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( instring, preloc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 2325, in 
> parseImpl
> loc, exprtokens = e._parse( instring, loc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( instring, preloc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 2690, in 
> parseImpl
> loc, tokens = self.expr._parse( instring, loc, doActions, 
> callPreParse=False )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( 

Re: [Matplotlib-users] ginput then show causes segfault

2009-02-23 Thread Michael Droettboom
I can't reproduce this here (on RHEL4 with mpl 0.98.5).  What version of 
matplotlib is in the enthought distribution?

 > python
Python 2.5.2 (r252:60911, May  7 2008, 12:40:32)
[GCC 3.4.6 20060404 (Red Hat 3.4.6-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
 >>> import matplotlib
 >>> matplotlib.__version__
'0.98.5.3'

What would be helpful to narrow this down is a backtrace from gdb.  Just 
run "gdb python", then "run script.py" (where script.py is the path to 
the script that segfaults).  When it segfaults, it should drop you back 
to the debugger prompt, where you can type "bt" to get a backtrace.  
Copy-and-paste that back here, and it may give us some clues.

Mike



Goyo wrote:
> El sáb, 21-02-2009 a las 16:26 -0800, Daniel Soto escribió:
>   
>> i'd like to plot some data, get user input, and then plot the original  
>> data and user input.  when i try to show() the data i get a segfault  
>> after about ten seconds.
>>
>> any clue what i'm doing wrong?  using mac os x 10.5 with enthought  
>> distribution.
>>
>> thanks,
>> drs
>>
>> #!/usr/bin/env python
>>
>> import pylab
>>
>> x = pylab.arange(0,10,0.1)
>> y = pylab.sin(x)
>>
>> # plot and get user input, then close fig
>> pylab.plot(x,y)
>> points = pylab.ginput(2)
>> points = pylab.array(points)
>> pylab.close()
>>
>> # replot with chosen points
>> pylab.plot(x,y)
>> pylab.plot(points[:,0],points[:,1],'ko')
>> pylab.show()
>> # wait for it, wait for it...now segfault
>> 
>
> Your code works for me in Ubuntu 8.10, mpl 0.98.5.2 (Debian package!)
> and GTKAgg backend.
>
> Goyo
>
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Backend problem

2009-02-23 Thread Michael Droettboom
What platform are you on?

There is apparently no good way to find the path to the Tcl/Tk header 
files.  The setup script currently tries to import Tkinter, and create a 
window, in order to make an API call that returns the path.  (Crazy, I 
know).  Therefore, if it can't create a window (for example you're on a 
remote terminal without X forwarding), this will fail.  In that case, 
matplotlib uses a hardcoded path to Tcl/Tk which is platform-specific.  
Does it fail to compile the TkAgg backend later on?  If so, can you send 
the compiler output message?  That will at least show us where it is 
looking for the Tcl/Tk header files.

Note that different versions of Tcl/Tk and different Linux distributions 
put these files in different places, so it's a constant battle to keep 
up with the hardcoded paths.  If you're running the latest Whiz-bang 
Linux Alpha, or something, that might explain it.

Mike

Nils Wagner wrote:
> Hi all,
>
> How can I resolve the following backend problem ?
> What are the default library and include directories for 
> tcl and tk ?
> Where should I define DISPLAY in that context ?
>
> python setup.py build --help
>
> OPTIONAL BACKEND DEPENDENCIES
>  libpng: 1.2.7
> Tkinter: Tkinter: 50704, Tk: 8.4, Tcl: 8.4
>  * Using default library and 
> include directories for
>  * Tcl and Tk because a Tk window 
> failed to open.
>  * You may need to define DISPLAY 
> for Tk to work so
>  * that setup can determine where 
> your libraries are
>  * located.
>
>
> Any pointer would be appreciated.
>
>   Nils
>   
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   

-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tkinter problems

2009-02-23 Thread Gregor Skrt
   1.   Where can I find a good tutorial or set of examples for
  embeding  matplotlib in Tkinter ?
   2. Problem: I created a simple test with Tkinter. First I plot my
  graph on __init__ (it works ok). Then I want to clear graph and
  plot on the same canvas with different parameters. The thing is
  that plot shows up only when I resize my window. Any idea what
  could I be doing wrong ? I was trying draw method but it doasn't
  work...


Here is my code:

Thanks for your help. Gregor Skrt




#!/usr/bin/env python

import matplotlib
matplotlib.use('TkAgg')

from numpy import arange, sin, pi , cos
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg,
NavigationToolbar2TkAgg
from matplotlib.figure import Figure

from Tkinter import *
import sys

class App:
def __init__(self,master):
frame = Frame(master)
frame.pack()
   
self.button= Button(frame,text='Quit',fg="black",command=frame.quit)
self.button.pack(side=LEFT)
   
self.hi_there=Button(frame,text="Plot Inverse
sin",command=self.plotnew)
self.hi_there.pack(side=LEFT)
   
# place a graph somewhere here
self.f = Figure(figsize=(5,4), dpi=100)
self.a = self.f.add_subplot(111)
self.t = arange(0.0,3.0,0.01)
self.s = sin(2*pi*self.t)
self.a.grid(True)
self.a.set_xlabel("cas [s]")
self.a.set_ylabel("amplituda")
self.a.plot(self.t,self.s)
   
self.canvas = FigureCanvasTkAgg(self.f, master=root)
self.canvas.show()
self.canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
   
def plotnew(self):
#get values from controller board, database
#self.f.clf()# clear the figure
self.t=arange(0.0,5.0,0.05)
self.s1=sin(2*pi*self.t)
self.s2=self.s1*-1
self.a.plot(self.t,self.s1,self.t,self.s2)
   

root=Tk()
app=App(root)
root.mainloop()   
#!/usr/bin/env python

import matplotlib
matplotlib.use('TkAgg')

from numpy import arange, sin, pi , cos
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg, NavigationToolbar2TkAgg
from matplotlib.figure import Figure

from Tkinter import *
import sys

class App:
	def __init__(self,master):
		frame = Frame(master)
		frame.pack()
		
		self.button= Button(frame,text='Quit',fg="black",command=frame.quit)
		self.button.pack(side=LEFT)
		
		self.hi_there=Button(frame,text="Plot Inverse sin",command=self.plotnew)
		self.hi_there.pack(side=LEFT)
		
		# place a graph somewhere here
		self.f = Figure(figsize=(5,4), dpi=100)
		self.a = self.f.add_subplot(111)
		self.t = arange(0.0,3.0,0.01)
		self.s = sin(2*pi*self.t)
		self.a.grid(True)
		self.a.set_xlabel("cas [s]")
		self.a.set_ylabel("amplituda")
		self.a.plot(self.t,self.s)
		
		self.canvas = FigureCanvasTkAgg(self.f, master=root)
		self.canvas.show()
		self.canvas.get_tk_widget().pack(side=TOP, fill=BOTH, expand=1)
		
	def plotnew(self):
		#self.f.clf()# clear the figure
		self.t=arange(0.0,5.0,0.05)
		self.s1=sin(2*pi*self.t)
		self.s2=self.s1*-1
		self.a.plot(self.t,self.s1,self.t,self.s2)
		

root=Tk()
app=App(root)
root.mainloop()		--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] basemap drawcountries consistency

2009-02-23 Thread Andres Luhamaa
Hello!
When trying to make a simple map of Europe with countries drawn, one can 
see that coastlines and country borders are not consistent.
Borders between Finland-Russia, Sweden-Norway, Germany-Denmark finish 
somewhere in the sea, to name just a few. Is this a known issue and is 
there a solution (coming at least)?

Simple script, little zooming will help to see better.

Best regards,
Andres

Simple script:
#!/usr/bin/env python
import numpy as np
from mpl_toolkits.basemap import Basemap
import matplotlib.pyplot as plt
m=Basemap(llcrnrlon=-18.7,llcrnrlat=44.0,urcrnrlon=59.,urcrnrlat=63.2,
  projection='lcc',lat_0=60,lon_0=0.,
  resolution ='i',area_thresh=1000.)
fig=plt.Figure()
m.drawcoastlines()
m.drawcountries()
plt.show()

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap drawcountries consistency

2009-02-23 Thread Jeff Whitaker
Andres Luhamaa wrote:
> Hello!
> When trying to make a simple map of Europe with countries drawn, one can 
> see that coastlines and country borders are not consistent.
> Borders between Finland-Russia, Sweden-Norway, Germany-Denmark finish 
> somewhere in the sea, to name just a few. Is this a known issue and is 
> there a solution (coming at least)?
>
> Simple script, little zooming will help to see better.
>
> Best regards,
> Andres
>
> Simple script:
> #!/usr/bin/env python
> import numpy as np
> from mpl_toolkits.basemap import Basemap
> import matplotlib.pyplot as plt
> m=Basemap(llcrnrlon=-18.7,llcrnrlat=44.0,urcrnrlon=59.,urcrnrlat=63.2,
>   projection='lcc',lat_0=60,lon_0=0.,
>   resolution ='i',area_thresh=1000.)
> fig=plt.Figure()
> m.drawcoastlines()
> m.drawcountries()
> plt.show()
>
>   
Andres:  We get the country boundary database from Generic Mapping 
Tools, so unless they fix it, we won't have a fix.  If you can suggest a 
better database that does not have this problem, I can try to 
incorporate it.

I guess it is possible is also possible that this is intentional - and 
the border does extend into the sea.

-Jeff


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Crash when trying to show a semilog or log-log plot

2009-02-23 Thread Michael Droettboom
Thanks for getting to the bottom of this.  I'll add some comments to the 
bug, too.

Mike

Craig Finch wrote:
> Okay, I figured it out.  The people who maintain the Gentoo ebuild for 
> matplotlib decided to remove the "unnecessary" copies of fonts, pycxx and 
> pyparser that are bundled with matplotlib.  The latest version of the ebuild 
> contains code that explicitly removes the bundled fonts, pyparser and pycxx 
> modules.  I would never have thought to look there if you hadn't pointed this 
> out.  I posted a bug on Gentoo (260025) requesting that they use the bundled 
> pyparsing module, and check with the matplotlib developers about the other 
> "redundant" packages before deleting them.
>
> Thanks for your help.
>
>Craig
>
>
>
> - Original Message 
> From: Michael Droettboom 
> To: Craig Finch 
> Cc: matplotlib-users@lists.sourceforge.net
> Sent: Monday, February 23, 2009 9:49:06 AM
> Subject: Re: [Matplotlib-users] Crash when trying to show a semilog or 
> log-log plot
>
> Strange.  I am unable to reproduce this with 0.98.2 (0.98.3 or 0.98.5)...
>
> It's happening inside of the math expression renderer, which is used to draw 
> the exponents that happen with semilog and log-log axes.  It doesn't, 
> however, appear to be font-related, which is a frequent installation/system 
> problem.
>
> What is strange about this traceback is that it is using the system-wide 
> installed version of pyparsing.py, and not the one that comes with 
> matplotlib.  matplotlib is very sensitive to small version changes in 
> pyparsing, so we distribute our own copy and try to use it.  If you 
> temporarily move /usr/lib/python2.4/site-packages/pyparsing.py to another 
> location, does that solve the problem?  If so, I will look into how we're 
> importing pyparsing.py to ensure we always use the local copy.
>
> Mike
>
> Craig Finch wrote:
>   
>> I am using matplotlib-0.98.5.2 and getting a strange crash when trying to 
>> show() a window with semilog or log-log axes.  Here is a simple script that 
>> will cause the crash:
>>
>> import pylab
>> from numpy import *
>> x = arange(1., 10., 0.1)
>> y = x**2
>> pylab.semilogx(x,y)
>> pylab.show()
>>
>> At the end of this message is a sample of the output.  I had to cut it down 
>> because it's apparently stuck in a loop in pyparsing.py and keeps outputting 
>> the same repetitive message.  Did I find a bug here?  Any suggestions would 
>> be appreciated.
>>
>>Craig
>>
>> Sample output:
>> --
>>   File 
>> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 
>> 352, in expose_event
>> self._render_figure(self._pixmap, w, h)
>>   File 
>> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", 
>> line 75, in _render_figure
>> FigureCanvasAgg.draw(self)
>>   File 
>> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
>> 279, in draw
>> self.figure.draw(self.renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/figure.py", line 772, 
>> in draw
>> for a in self.axes: a.draw(renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1601, in 
>> draw
>> a.draw(renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in 
>> draw
>> tick.draw(renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in 
>> draw
>> self.label1.draw(renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 452, in 
>> draw
>> bbox, info = self._get_layout(renderer)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 252, in 
>> _get_layout
>> w, h, d = renderer.get_text_width_height_descent(
>>   File 
>> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
>> 152, in get_text_width_height_descent
>> ox, oy, width, height, descent, fonts, used_characters = \
>>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 
>> 2808, in parse
>> box = self._parser.parse(s, font_output, fontsize, dpi)
>>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 
>> 2259, in parse
>> self._expression.parseString(s)
>>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 1065, in 
>> parseString
>> loc, tokens = self._parse( instring, 0 )
>>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
>> _parseCache
>> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
>> _parseNoCache
>> loc,tokens = self.parseImpl( instring, preloc, doActions )
>>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 2577, in 
>> parseImpl
>> return self.expr._parse( instring, loc, doActions, callPreParse=False )
>>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
>> _parseCache
>> value = self._parseN

Re: [Matplotlib-users] matplotlib issue: cannot auto-scale X axis of plop properly

2009-02-23 Thread brent.nash

Thanks for the feedback.  So strangely enough it seems to have something to
do with my installation of matplotlib or some of the other background
libraries.

I took the exact same example that I sent it and ran it on Redhat Enterprise
Linux 4 and it works just fine.  My team develops on Mac OS X & Linux, but
only deploys on Linux, so this isn't a huge problem, but it'd be nice to
have it working everywhere?

Is there any definitive set of instructions for getting matplotlib to build
and install properly on Mac OS X 10.5?  I had to install all of the
following on my Mac:

numpy
scipy
libpng
freetype
Fortran compiler (F95 I think)
pkgconfig
matplotlib
nose

Undoubtedly there's plenty of opportunity in there for me to mess something
up.  Thanks for all the feedback so far.

~Brent


Jae-Joon Lee wrote:
> 
> What version of maploltib are you using?
> Your data displayed with correct scale with my installation of
> matplotlib 0.98.5.2.
> By the way, you're chaning the axes limit of the wrong axes.
> "matplotlib.pyplot.axes()" create a new axes.
> 
> Use plt.xlim (or plt.ylim for y-limit), or use the method of the existing
> axes.
> 
> -JJ
> 
> 
> 
> 
> On Thu, Feb 19, 2009 at 8:22 PM, Nash, Brent R
>  wrote:
>> Hey everyone,
>>
>> I'm fairly new to matplotlib, but have read through tons of the
>> documentation today and have a decent understanding of it.  All the
>> auto-scaling, xlim, and x_bound stuff works fine for me with the
>> examples,
>> but as soon as I try to use it on my data, it's not working for me.  I've
>> attached a demo script, 2 input files of data, and a PNG showing the
>> resulting chart I get.  The numbers on my Y-axis range from 7656 to 59928
>> (a
>> difference of 52272) and the numbers on my X-axis range from
>> 1.22896144017e+12 to 1.22896155012e+12 (a difference of 109950).
>>
>> The plot should look like a monotonically increasing line, but the
>> resulting
>> plot always comes out looking like a vertical line.  I realize that the
>> plot
>> is actually correct, the problem is the default scaling on the ouptut. 
>> The
>> easy way to justify this to yourself is to take the line "ert = float(i)"
>> in
>> the script and replace it with "ert = float(i)  - 122896000" to
>> reduce
>> the ert #'s to a manageable size and then everything plots very nicely. 
>> The
>> data is all linear, not logarithmic or anything, so I don't think writing
>> a
>> custom scaler is the solution.
>>
>> I left commented out sections in my script of all the different methods
>> I've
>> tried to scale this thing.  I've tried all permutations I could think of
>> for
>> the following functions:
>>
>> matplotlib.pyplot.axes().autoscale_view(...)
>> matplotlib.pyplot.axes().set_xbound(...)
>> matplotlib.pyplot.axes().set_xlim(...)
>> matplotlib.pyplot.axes().set_aspect(...)
>> matplotlib.pyplot.axis(...)
>> matplotlib.pyplot.axes().set_xscale(...)
>>
>> Can anyone catch what I'm doing wrong here?  I'm hoping it's just
>> something
>> obvious due to my unfamiliarity with the tool.
>>
>> Is there any way to write my own custom autoscale algorithm?
>>
>> Thanks very much for your time/help!
>>
>> ~Brent
>>
>> PS ~ Here's my OS info:
>>
>> MacBook Pro Laptop
>> Mac O X 10.5.6
>> 2.6 GHz Intel Core 2 Duo
>> 4GB 667 MHz DDR2 SDRAM
>> --
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
>> CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the
>> Enterprise
>> -Strategies to boost innovation and cut costs with open source
>> participation
>> -Receive a $600 discount off the registration fee with the source code:
>> SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>
> 
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco,
> CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the
> Enterprise
> -Strategies to boost innovation and cut costs with open source
> participation
> -Receive a $600 discount off the registration fee with the source code:
> SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/matplotlib-issue%3A-cannot-auto-scale-X-axis-of-plop-properly-tp22154005p22165604.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterpr

Re: [Matplotlib-users] Crash when trying to show a semilog or log-log plot

2009-02-23 Thread Craig Finch

Okay, I figured it out.  The people who maintain the Gentoo ebuild for 
matplotlib decided to remove the "unnecessary" copies of fonts, pycxx and 
pyparser that are bundled with matplotlib.  The latest version of the ebuild 
contains code that explicitly removes the bundled fonts, pyparser and pycxx 
modules.  I would never have thought to look there if you hadn't pointed this 
out.  I posted a bug on Gentoo (260025) requesting that they use the bundled 
pyparsing module, and check with the matplotlib developers about the other 
"redundant" packages before deleting them.

Thanks for your help.

   Craig



- Original Message 
From: Michael Droettboom 
To: Craig Finch 
Cc: matplotlib-users@lists.sourceforge.net
Sent: Monday, February 23, 2009 9:49:06 AM
Subject: Re: [Matplotlib-users] Crash when trying to show a semilog or log-log 
plot

Strange.  I am unable to reproduce this with 0.98.2 (0.98.3 or 0.98.5)...

It's happening inside of the math expression renderer, which is used to draw 
the exponents that happen with semilog and log-log axes.  It doesn't, however, 
appear to be font-related, which is a frequent installation/system problem.

What is strange about this traceback is that it is using the system-wide 
installed version of pyparsing.py, and not the one that comes with matplotlib.  
matplotlib is very sensitive to small version changes in pyparsing, so we 
distribute our own copy and try to use it.  If you temporarily move 
/usr/lib/python2.4/site-packages/pyparsing.py to another location, does that 
solve the problem?  If so, I will look into how we're importing pyparsing.py to 
ensure we always use the local copy.

Mike

Craig Finch wrote:
> I am using matplotlib-0.98.5.2 and getting a strange crash when trying to 
> show() a window with semilog or log-log axes.  Here is a simple script that 
> will cause the crash:
> 
> import pylab
> from numpy import *
> x = arange(1., 10., 0.1)
> y = x**2
> pylab.semilogx(x,y)
> pylab.show()
> 
> At the end of this message is a sample of the output.  I had to cut it down 
> because it's apparently stuck in a loop in pyparsing.py and keeps outputting 
> the same repetitive message.  Did I find a bug here?  Any suggestions would 
> be appreciated.
> 
>Craig
> 
> Sample output:
> --
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtk.py", line 
> 352, in expose_event
> self._render_figure(self._pixmap, w, h)
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_gtkagg.py", 
> line 75, in _render_figure
> FigureCanvasAgg.draw(self)
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
> 279, in draw
> self.figure.draw(self.renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/figure.py", line 772, in 
> draw
> for a in self.axes: a.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axes.py", line 1601, in 
> draw
> a.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 710, in 
> draw
> tick.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/axis.py", line 193, in 
> draw
> self.label1.draw(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 452, in 
> draw
> bbox, info = self._get_layout(renderer)
>   File "//usr/lib/python2.4/site-packages/matplotlib/text.py", line 252, in 
> _get_layout
> w, h, d = renderer.get_text_width_height_descent(
>   File 
> "//usr/lib/python2.4/site-packages/matplotlib/backends/backend_agg.py", line 
> 152, in get_text_width_height_descent
> ox, oy, width, height, descent, fonts, used_characters = \
>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 2808, 
> in parse
> box = self._parser.parse(s, font_output, fontsize, dpi)
>   File "//usr/lib/python2.4/site-packages/matplotlib/mathtext.py", line 2259, 
> in parse
> self._expression.parseString(s)
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 1065, in 
> parseString
> loc, tokens = self._parse( instring, 0 )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( instring, preloc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 2577, in 
> parseImpl
> return self.expr._parse( instring, loc, doActions, callPreParse=False )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 998, in 
> _parseCache
> value = self._parseNoCache( instring, loc, doActions, callPreParse )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py", line 941, in 
> _parseNoCache
> loc,tokens = self.parseImpl( instring, preloc, doActions )
>   File "/usr/lib/python2.4/site-packages/pyparsing.py"

Re: [Matplotlib-users] Polar Plot: Extraneous Circles

2009-02-23 Thread Eric Firing
mcdevitts wrote:
> Hello,
> 
> I've been trying to implement a smith chart like a previous gentlemen on the
> list and have run into a similar problem.  When my angle value goes from -pi
> to pi I get an extraneous circle from the interpolation.  From the previous
> posts, I am under the impression that this is a known issue and has been
> corrected.  Am I correct?  If so, I am still having this issue using version
> 0.98.5.2 of matplotlib.
> 
> Regards,
> Sean McDevitt


Yes, this is known and was fixed on January 2.  Can you update from svn?

Eric

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Polar bars and matplotlib 0.98.5

2009-02-23 Thread Eric Firing

Laurent Mychkine wrote:

hi,

I'm using polar bars to plot windroses. Since the 0.98.5 version i have
some issues with the plots.
The 0° bar is not displayed in the good way. This bar is
located between -0.26 radian and 0.26 radian but it is printed
counterclockwise.
It was working perfectly with matplotlib version 0.98.3. I just switched to
version 0.98.5 because of the NaN bug of the previous version.


The bug was fixed on Jan. 2.  Can you install mpl from svn?  Or just 
patch your installation with the attached diff?  (Only the first hunk is 
critical for the bug.)


Eric



Any idea how i could make it work again ?
Ty!!

from pylab import *
nb_secteur=12

fig = figure(2,figsize=(8,8))
ax = fig.add_axes([0.1, 0.1, 0.8, 0.8], polar=True,)

thetagrids([90,45,0,315,270,225,180,135],
labels=["N","NE","E","SE","S","SO","O","NO"])
theta = arange(0.0-pi/nb_secteur, 2*pi-pi/nb_secteur, 2*pi/nb_secteur)

radii = [10.,20,10,5,3,4,3,4,6,4,2,9]

width = 2*pi/nb_secteur

bars = ax.bar(theta, radii, width=width, bottom=0.0 )
for r,bar in zip(radii, bars):
bar.set_facecolor( 'blue')
bar.set_alpha(0.3)

text(1,0.69,"%",transform = ax.transAxes)
show()




--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H




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



Index: lib/matplotlib/projections/polar.py
===
--- lib/matplotlib/projections/polar.py (revision 6730)
+++ lib/matplotlib/projections/polar.py (revision 6731)
@@ -57,8 +57,6 @@
 
 def transform_path(self, path):
 vertices = path.vertices
-t = vertices[:, 0:1]
-t[t != (npy.pi * 2.0)] %= (npy.pi * 2.0)
 if len(vertices) == 2 and vertices[0, 0] == vertices[1, 0]:
 return Path(self.transform(vertices), path.codes)
 ipath = path.interpolated(self._resolution)
@@ -174,6 +172,11 @@
 def refresh(self):
 return self.base.refresh()
 
+def view_limits(self, vmin, vmax):
+vmin, vmax = self.base.view_limits(vmin, vmax)
+return 0, vmax
+
+
 RESOLUTION = 75
 
 def __init__(self, *args, **kwargs):
@@ -280,6 +283,7 @@
 return Circle((0.5, 0.5), 0.5)
 
 def set_rmax(self, rmax):
+self.viewLim.y0 = 0
 self.viewLim.y1 = rmax
 angle = self._r_label1_position.to_values()[4]
 self._r_label1_position.clear().translate(

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Error messages with xpdf / LaTeX

2009-02-23 Thread Paul Anton Letnes


On 23. feb.. 2009, at 14.51, Darren Dale wrote:

On Mon, Feb 23, 2009 at 3:59 AM, Paul Anton Letnes > wrote:

Hi everyone,

I'm having issues using LaTeX text processing with the xpdf  
distiller. After playing with my settings, I finally managed to get  
vector graphics output using LaTeX test processing. However, a weird  
error message pops up in the terminal every time (mostly annoying,  
the plotting actually works):


Error: No paper information available - using defaults
Error: No display font for 'Courier'
Error: No display font for 'Courier-Bold'
Error: No display font for 'Courier-BoldOblique'
Error: No display font for 'Courier-Oblique'
Error: No display font for 'Helvetica'
Error: No display font for 'Helvetica-Bold'
Error: No display font for 'Helvetica-BoldOblique'
Error: No display font for 'Helvetica-Oblique'
Error: No display font for 'Symbol'
Error: No display font for 'Times-Bold'
Error: No display font for 'Times-BoldItalic'
Error: No display font for 'Times-Italic'
Error: No display font for 'Times-Roman'
Error: No display font for 'ZapfDingbats'

I attach my matplotlibrc file for reference. Note especially the  
stuff at the end with usetex=True and distiller = xpdf. If you know  
any other settings that might work better, please let me know! I  
suspect these settings are the sources of my annoying error messages.


Do you have the relevant latex font packages installed? Like psnfss?  
I suspect this is an issue with your latex installation, not  
matplotlib.


Darren



First of all, the "No paper info available" should not be relevant for  
fonts? Second, this problem appeared recently, after an upgrade of  
matplotlib. But, it could be that you are right. I still don't know  
how to fix it, though, and latex itself gives no error messages. I'm  
thinking there's something with xpdf.


Paul.--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap drawcountries consistency

2009-02-23 Thread Andres Luhamaa
Jeff Whitaker wrote:
> Andres Luhamaa wrote:
>   
>> Hello!
>> When trying to make a simple map of Europe with countries drawn, one can 
>> see that coastlines and country borders are not consistent.
>> Borders between Finland-Russia, Sweden-Norway, Germany-Denmark finish 
>> somewhere in the sea, to name just a few. Is this a known issue and is 
>> there a solution (coming at least)?
>>
>> Simple script, little zooming will help to see better.
>>
>> Best regards,
>> Andres
>>
>> Simple script:
>> #!/usr/bin/env python
>> import numpy as np
>> from mpl_toolkits.basemap import Basemap
>> import matplotlib.pyplot as plt
>> m=Basemap(llcrnrlon=-18.7,llcrnrlat=44.0,urcrnrlon=59.,urcrnrlat=63.2,
>>   projection='lcc',lat_0=60,lon_0=0.,
>>   resolution ='i',area_thresh=1000.)
>> fig=plt.Figure()
>> m.drawcoastlines()
>> m.drawcountries()
>> plt.show()
>>
>>   
>> 
> Andres:  We get the country boundary database from Generic Mapping 
> Tools, so unless they fix it, we won't have a fix.  If you can suggest a 
> better database that does not have this problem, I can try to 
> incorporate it.
>
> I guess it is possible is also possible that this is intentional - and 
> the border does extend into the sea.
>
> -Jeff
>   

Thank You for the answer. It really might be intentional, because the 
border in sea never seems to be straight when it is drawn and actually 
now looking the same borders in google maps, there is a strong 
similarity. But I still think there might be an option to not draw the 
borders on the sea, mask them out somehow. Would it be complicated to 
add such an option or am I the only one disturbed by such an appearance?

Andres
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>   


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] very simple question, aspect ratio

2009-02-23 Thread Eric Firing
Dante Plicato wrote:
> Hi Eric,
> first of all thank you for your reply.
> My problem is so simple that it is diffucult to explain :)
> may be pictures speak better than me.
> Let me show you 2 simple pictures and you'll understand:
> 
> this is what i want to do: (done with excel)
> http://89.96.100.40/~dante/wish.png
> (2 simple bars centered in a short enough x axis)
> 
> and this is what i have with matplotlib:
> http://89.96.100.40/~dante/hist.png

That's very helpful.  Using mpl from svn, I get quite a different 
result, and much closer to what you want.  What version of mpl are you 
using?  Can you update to the latest release, or to svn?  I think that 
if you do that, and use the bar examples included with mpl, you will be 
able to get the desired result.

Eric



> 
> Thank you again for your time,
> dp
> 
> 
> 2009/2/23 Eric Firing :
>> Dante Plicato wrote:
>>> Hi all,
>>> i just want to have a simple 2-bar histogram,
>>> and my problem is that i want my axis to be with NON-squared aspect,
>>> i.e. the y-axes automatically scaled (and this yet works this way),but
>>> the x-axis to be as long as it need to display  2 little bars.
>>> Instead i get a squared graph with 2 big bars.
>>> I also tried using something like   "plt.axis([0,1,0,mymax*1.2])",
>>> changing the second value, but this affects the scale and NOT my
>>> picture aspect ratio.
>> I'm sorry; I haven't been able to figure out what you want the plot to look
>> like, and I suspect others on the list may be having the same problem.
>>
>> When you describe the bars as "big" or "little", are you referring to width?
>>  Height?  spacing?
>>
>> When I run your script, I don't see anything that I would describe as
>> "squared aspect".  What physical dimensions would you like the axes to have,
>> and what physical dimensions would you like the bars to have?
>>
>> Maybe you can make a sketch using characters to show what you
>> want the plot to look like, e.g.,
>>
>> ___
>> | |
>> |     |
>> |   |  |  |
>> |   |  |  |  ||
>> ---
>>
>> Also, is there a reason you are using two calls to "bar" instead of one?
>> Note that arguments such as color can be sequences.
>>
>> Eric
>>
>>>
>>> This is my simploe source:
>>>
>>> import numpy as np
>>> import matplotlib
>>> import matplotlib.pyplot as plt
>>>
>>> N = 1
>>> ind = np.arange(N)
>>> width = 0.05
>>>
>>> rects2 = plt.bar(ind+width, 100, width, color='g')
>>> rects1 = plt.bar(ind, 200, width, color='b')
>>>
>>> I tried many things, figsize, axis.. i have no idea,
>>> probably because i'm new to matplotlib programming
>>>
>>> Thank you very much for any help,
>>> my best
>>>

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Adding custom axes within a subplot

2009-02-23 Thread Johann Rohwer

Johann Rohwer wrote:
I'm trying to insert a custom set of axes within a subplot, much like 
the axes_demo.py. Only difference is, now I want an inset graph 
inside each of a number of subplots. Using ASCII art, much like the 
following:



|---|
|   |
|   |
|  -|
|  |   ||
|  -|
|---|

|---|
|   |
|   |
|  -|
|  |   ||
|  -|
|---|

Where the whole thing would be the figure, containing 2 subplots each 
with an inset.


Is there any way to have the rect coordinates of
fig.add_axes(rect)
to refer to the axes coordinates of the respective subplot, and not of 
the complete figure? (In reality there are actually 12 subplots, not 
only 2


To answer my own question, after browsing the docstrings I came up with the 
following attached minimal script to illustrate a solution to the problem. 
However, it appears crufty. Specifically,


1. Can the fig.add_axes() call not take a transform directly as optional 
argument, like in fig.add_axes([.4, .1, .5, .3], transform=ax.transAxes)? 
This would appear the natural solution but does not work.


2. The transformed bounding box gives coordinates in points, necessitating 
the division by figure width and figure height to revert back to fractional 
coordinates.


3. Re-calculating [l, b, w, h] from tBbox seems cumbersome. Can the 
add_axes() not call a Bbox instance directly?


I'm sure I'm missing something obvious but don't have the time to delve into 
the transforms sourcecode, so any pointer is appreciated :-)


Johann

#!/usr/bin/env python

# test script to insert custom subplots within subplots
# jr -- 20090223

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

fig = plt.figure(figsize=(8,6))
fw = fig.get_figwidth()*fig.get_dpi()
fh = fig.get_figheight()*fig.get_dpi()

x = np.linspace(1,10,100)
y = np.sin(x)

for i in range(4):
ax = fig.add_subplot(2,2,i+1)
ax.plot(x,3+y,'b-')
ax.set_ylim(0,4.5)
Bbox = matplotlib.transforms.Bbox.from_bounds(.4, .1, .5, .3)
tBbox = matplotlib.transforms.TransformedBbox(Bbox, ax.transAxes).get_points()
l, b, w, h = tBbox[0,0]/fw, tBbox[0,1]/fh, (tBbox[1,0]-tBbox[0,0])/fw, (tBbox[1,1]-tBbox[0,1])/fh
axins = fig.add_axes([l, b, w, h])
axins.plot(x,y,'r-')

fig.show()


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Fontsize of tick labels

2009-02-23 Thread Johann Rohwer
Is there any way of conveniently changing the font size of tick labels using 
the object-oriented interface?

I'm aware of plt.xticks(fontsize=6), which does this globally for a figure, 
but if I have a number of custom axes of which I only want to change the 
tick-fontsize of a selected few, I've only been able to come up with
ax1.xaxis.set_ticklabels([0,1,2,3,4,5], fontsize=6)
This involves manually specifying the tick labels. However, I'm perfectly 
happy with the labels as supplied by ScalarFormatter and only want to change 
the font size. How to do this?

Regards
Johann



--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Adding custom axes within a subplot

2009-02-23 Thread Jae-Joon Lee
Here is my modification.

Bbox = matplotlib.transforms.Bbox.from_bounds(.4, .1, .5, .3)
trans = ax.transAxes + fig.transFigure.inverted()
l, b, w, h = matplotlib.transforms.TransformedBbox(Bbox, trans).bounds
axins = fig.add_axes([l, b, w, h])


On Mon, Feb 23, 2009 at 2:49 PM, Johann Rohwer  wrote:
> Johann Rohwer wrote:
>
> To answer my own question, after browsing the docstrings I came up with the
> following attached minimal script to illustrate a solution to the problem.
> However, it appears crufty. Specifically,
>
> 1. Can the fig.add_axes() call not take a transform directly as optional
> argument, like in fig.add_axes([.4, .1, .5, .3], transform=ax.transAxes)?
> This would appear the natural solution but does not work.
>

The axes position should be given in the normalized figure coordinates.

> 2. The transformed bounding box gives coordinates in points, necessitating
> the division by figure width and figure height to revert back to fractional
> coordinates.

With my modification, you don't need this anymore.

>
> 3. Re-calculating [l, b, w, h] from tBbox seems cumbersome. Can the
> add_axes() not call a Bbox instance directly?

Also see my modification.
I'm sorry but I don't understand what you mean by "add_axes() not call
a Bbox instance directly?".

IHTH,

-JJ

>
> I'm sure I'm missing something obvious but don't have the time to delve into
> the transforms sourcecode, so any pointer is appreciated :-)
>
> Johann
>
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>
>

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fontsize of tick labels

2009-02-23 Thread Jae-Joon Lee
On Mon, Feb 23, 2009 at 3:06 PM, Johann Rohwer  wrote:
> Is there any way of conveniently changing the font size of tick labels using
> the object-oriented interface?
>
> I'm aware of plt.xticks(fontsize=6), which does this globally for a figure,
> but if I have a number of custom axes of which I only want to change the
> tick-fontsize of a selected few, I've only been able to come up with
>ax1.xaxis.set_ticklabels([0,1,2,3,4,5], fontsize=6)
> This involves manually specifying the tick labels. However, I'm perfectly
> happy with the labels as supplied by ScalarFormatter and only want to change
> the font size. How to do this?
>

for t in ax1.get_xticklabels():
t.set_fontsize(6.)

Or with matplotlib.artist.setp function,

setp(ax1.get_xticklabels(), fontsize=6)

-JJ


> Regards
> Johann
>
>
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Tkinter problems

2009-02-23 Thread Delbert Franz
On Monday 23 February 2009, Gregor Skrt wrote:
>1.   Where can I find a good tutorial or set of examples for
>   embeding  matplotlib in Tkinter ?
>2. Problem: I created a simple test with Tkinter. First I plot my
>   graph on __init__ (it works ok). Then I want to clear graph and
>   plot on the same canvas with different parameters. The thing is
>   that plot shows up only when I resize my window. Any idea what
>   could I be doing wrong ? I was trying draw method but it doasn't
>   work...
> 
> 
> Here is my code:
> 
> Thanks for your help. Gregor Skrt
> 
> 
> 
> 
Here are a few links for item #1 in your list.  I'm not yet skilled enough 
to quickly answer #2.  In summary, information about Tkinter is scattered
about in various places:)--at least my take on it.

Here are two links to get you started:

http://www.astro.washington.edu/users/rowen/TkinterSummary.html


This page has quite a few links to resources on Tkinter:

http://wiki.python.org/moin/TkInter

There is a complete book on the subject by Grayson, that is
from 2000.  All the examples were online the last time I checked (
some years ago).  Also there are used book copies for about $60 US that 
can be found from the wiki.python.org link. 

I am planning to get back into Tkinter soon.  I have developed a 
time-series plotting package but have not touched it in almost two
years:(  Thus I have to re-learn a few things because I wasn't an 
expert when I had to move to other things--things that earned me 
billable hours!

One final observation:  I find GUI programming to be a challenge but a lot
of fun.  However, it takes time, at least for me, to work out many of the
details.  However, matplotlib is an excellent tool to put at the heart of
anything used to plot technical data.  Almost all of my software development
from 1963 on has been in Fortran.  Still working on getting my "mind wrapped"
around object-oriented software and Python:)  Python is my platform of choice
for any GUI development that I do.  I find it a fantastic language!!

Hope this helps your. 

 Delbert

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap drawcountries consistency

2009-02-23 Thread Jeff Whitaker
Andres Luhamaa wrote:
> Jeff Whitaker wrote:
>   
>> Andres Luhamaa wrote:
>>   
>> 
>>> Hello!
>>> When trying to make a simple map of Europe with countries drawn, one can 
>>> see that coastlines and country borders are not consistent.
>>> Borders between Finland-Russia, Sweden-Norway, Germany-Denmark finish 
>>> somewhere in the sea, to name just a few. Is this a known issue and is 
>>> there a solution (coming at least)?
>>>
>>> Simple script, little zooming will help to see better.
>>>
>>> Best regards,
>>> Andres
>>>
>>> Simple script:
>>> #!/usr/bin/env python
>>> import numpy as np
>>> from mpl_toolkits.basemap import Basemap
>>> import matplotlib.pyplot as plt
>>> m=Basemap(llcrnrlon=-18.7,llcrnrlat=44.0,urcrnrlon=59.,urcrnrlat=63.2,
>>>   projection='lcc',lat_0=60,lon_0=0.,
>>>   resolution ='i',area_thresh=1000.)
>>> fig=plt.Figure()
>>> m.drawcoastlines()
>>> m.drawcountries()
>>> plt.show()
>>>
>>>   
>>> 
>>>   
>> Andres:  We get the country boundary database from Generic Mapping 
>> Tools, so unless they fix it, we won't have a fix.  If you can suggest a 
>> better database that does not have this problem, I can try to 
>> incorporate it.
>>
>> I guess it is possible is also possible that this is intentional - and 
>> the border does extend into the sea.
>>
>> -Jeff
>>   
>> 
>
> Thank You for the answer. It really might be intentional, because the 
> border in sea never seems to be straight when it is drawn and actually 
> now looking the same borders in google maps, there is a strong 
> similarity. But I still think there might be an option to not draw the 
> borders on the sea, mask them out somehow. Would it be complicated to 
> add such an option or am I the only one disturbed by such an appearance?
>
> Andres
>   

Andres:  It might be possible, but it certainly wouldn't be trivial.  
You would have to compute the intersection of the country boundaries 
with the coastline polygons and then clip.  

-Jeff
>> --
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>> -Strategies to boost innovation and cut costs with open source participation
>> -Receive a $600 discount off the registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
>>   
>> 
>
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>   


-- 
Jeffrey S. Whitaker Phone  : (303)497-6313
Meteorologist   FAX: (303)497-6449
NOAA/OAR/PSD  R/PSD1Email  : jeffrey.s.whita...@noaa.gov
325 BroadwayOffice : Skaggs Research Cntr 1D-113
Boulder, CO, USA 80303-3328 Web: http://tinyurl.com/5telg


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] basemap drawcountries consistency

2009-02-23 Thread Eric Firing
Jeff Whitaker wrote:
> Andres Luhamaa wrote:
>> Jeff Whitaker wrote:
>>   
>>> Andres Luhamaa wrote:
>>>   
>>> 
 Hello!
 When trying to make a simple map of Europe with countries drawn, one can 
 see that coastlines and country borders are not consistent.
 Borders between Finland-Russia, Sweden-Norway, Germany-Denmark finish 
 somewhere in the sea, to name just a few. Is this a known issue and is 
 there a solution (coming at least)?

 Simple script, little zooming will help to see better.

 Best regards,
 Andres

 Simple script:
 #!/usr/bin/env python
 import numpy as np
 from mpl_toolkits.basemap import Basemap
 import matplotlib.pyplot as plt
 m=Basemap(llcrnrlon=-18.7,llcrnrlat=44.0,urcrnrlon=59.,urcrnrlat=63.2,
   projection='lcc',lat_0=60,lon_0=0.,
   resolution ='i',area_thresh=1000.)
 fig=plt.Figure()
 m.drawcoastlines()
 m.drawcountries()
 plt.show()

   
 
   
>>> Andres:  We get the country boundary database from Generic Mapping 
>>> Tools, so unless they fix it, we won't have a fix.  If you can suggest a 
>>> better database that does not have this problem, I can try to 
>>> incorporate it.
>>>
>>> I guess it is possible is also possible that this is intentional - and 
>>> the border does extend into the sea.
>>>
>>> -Jeff
>>>   
>>> 
>> Thank You for the answer. It really might be intentional, because the 
>> border in sea never seems to be straight when it is drawn and actually 
>> now looking the same borders in google maps, there is a strong 
>> similarity. But I still think there might be an option to not draw the 
>> borders on the sea, mask them out somehow. Would it be complicated to 
>> add such an option or am I the only one disturbed by such an appearance?
>>
>> Andres
>>   
> 
> Andres:  It might be possible, but it certainly wouldn't be trivial.  
> You would have to compute the intersection of the country boundaries 
> with the coastline polygons and then clip.  


Jeff, Andres,

As a workaround, maybe one could use a suitable combination of opaque 
ocean patches, and setting the zorders of the ocean patches and the 
country boundaries so that the latter are lower then the former.

Eric

> 
> -Jeff
>>> --
>>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>>> -Strategies to boost innovation and cut costs with open source participation
>>> -Receive a $600 discount off the registration fee with the source code: SFAD
>>> http://p.sf.net/sfu/XcvMzF8H
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>>
>>>   
>>> 
>>
>> --
>> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
>> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
>> -Strategies to boost innovation and cut costs with open source participation
>> -Receive a $600 discount off the registration fee with the source code: SFAD
>> http://p.sf.net/sfu/XcvMzF8H
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>   
> 
> 


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Python 2.6 installer for Windows?

2009-02-23 Thread Adam Mercer
On Sun, Feb 22, 2009 at 16:59, Wai Yip Tung  wrote:

> I find that Matplotlib only have Python 2.5 build for Windows. Is there
> any plan to release a 2.6 build soon? I am trying to build it from source
> but I run into numerous problem. I am still struggling to find all
> dependent packages. It will help a lot if the 2.6 installer is available.

AFAIK matplolib doesn't support python-2.6 yet, as NumPy doesn't.
NumPy is expected to get python-2.6 support in the 1.3 release, so I
imagine matplotlib will support python-2.6 in a release following the
NumPy-1.3 release.

Cheers

Adam

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Python 2.6 installer for Windows?

2009-02-23 Thread Patrick Marsh
I have built matplotlib (and numpy since it is required for
matplotlib) with python2.6.  Please note that these are UNSUPPORTED
and you use them at your own risk.  They were built from the 9
February 2009 SVN so use at your own risk.  You will have to install
numpy first and matplotlib second.  I would also recommend installing
WxPython before installing matplotlib since there are some bugs using
Tkinter with matplotlib on python2.6.  I've been too busy to try and
track it down.

http://code.patricktmarsh.com/builds/

-Patrick




On Sun, Feb 22, 2009 at 4:59 PM, Wai Yip Tung  wrote:
> Hello all,
>
> I find that Matplotlib only have Python 2.5 build for Windows. Is there
> any plan to release a 2.6 build soon? I am trying to build it from source
> but I run into numerous problem. I am still struggling to find all
> dependent packages. It will help a lot if the 2.6 installer is available.
>
> Thanks,
>
> Wai Yip
>
>
> --
> Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
> -OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
> -Strategies to boost innovation and cut costs with open source participation
> -Receive a $600 discount off the registration fee with the source code: SFAD
> http://p.sf.net/sfu/XcvMzF8H
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>



-- 
Patrick Marsh
Graduate Research Assistant
School of Meteorology
University of Oklahoma
http://www.patricktmarsh.com

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] TclError Couldn't Connect to display ":0.0"

2009-02-23 Thread rlp_GMC


-- 
View this message in context: 
http://www.nabble.com/TclError-Couldn%27t-Connect-to-display-%22%3A0.0%22-tp22176082p22176082.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] TclError Couldn't Connect to display ":0.0"

2009-02-23 Thread rlp_GMC

When I try to save a fig to a file  I get the error 

TclError Couldn't Connect to display ":0.0"  

I looked in the Maplotlib users manual  (latest version pg 144-146)  and
tried the following with no luck. BTW why is the same module named
differently Linux/Win ?

import matplotlib
matplotlib.use('Agg')
import matplotlib.pylab as plt (linux )   or,  import matplotlib.pyplot as
plt   (Windows)
fig = plt.figure()
ax = fig.add_subplot(111)
ax.plot([1,2,3])
fig.savefig('test.png')

Is Matplotlib trying to display a plot to the monitor? 

rlp
-- 
View this message in context: 
http://www.nabble.com/TclError-Couldn%27t-Connect-to-display-%22%3A0.0%22-tp22176192p22176192.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot windows

2009-02-23 Thread Paul Anton Letnes
Hello,

I want to save a large number of figures to file, roughly like this:

import pylab
for i in xrange(100):
 pylab.plot(x[i], y[i])
 pylab.savefig('plot' + str(i) + '.eps')
 pylab.figure()

However, a large number of figure windows show up on screen, and  
eventually, the application runs out of memory and crashes. How do I  
avoid these windows?

Regards,
Paul.


--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot windows

2009-02-23 Thread Eric Firing
Paul Anton Letnes wrote:
> Hello,
> 
> I want to save a large number of figures to file, roughly like this:
> 
> import pylab
> for i in xrange(100):
>  pylab.plot(x[i], y[i])
>  pylab.savefig('plot' + str(i) + '.eps')
>  pylab.figure()
> 
> However, a large number of figure windows show up on screen, and  
> eventually, the application runs out of memory and crashes. How do I  
> avoid these windows?

Replace the pylab.figure() command with pylab.clf(), or with pylab.close().

Eric

> 
> Regards,
> Paul.
> 

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Adding custom axes within a subplot

2009-02-23 Thread Johann Rohwer
Hi JJ

On Monday, 23 February 2009, Jae-Joon Lee wrote:
> Here is my modification.
>
> Bbox = matplotlib.transforms.Bbox.from_bounds(.4, .1, .5, .3)
> trans = ax.transAxes + fig.transFigure.inverted()
> l, b, w, h = matplotlib.transforms.TransformedBbox(Bbox,
> trans).bounds 
> axins = fig.add_axes([l, b, w, h]) 

Thanks for this - works like a charm. My experience with 
transformations is very limited but I can see that they are very 
powerful...

> > 3. Re-calculating [l, b, w, h] from tBbox seems cumbersome. Can
> > the add_axes() not call a Bbox instance directly?
>
> Also see my modification.
> I'm sorry but I don't understand what you mean by "add_axes() not
> call a Bbox instance directly?".

This has been answered by your modification - I wasn't aware of 
the .bounds attribute of a bounding box, which gives the required 
input to add_axes().

Thanks again
Johann

--
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users