[matplotlib-devel] default "q" shortcut?

2009-10-21 Thread Georg Brandl
Hi,

one thing I missed when I switched from Gnuplot to matplotlib was that I
can't press "q" to close a window but have to use the window manager; in
one environment I work in that means I have to use the mouse to close a
window.

I made a custom key handler that does the following:

try:
event.canvas.manager.destroy()
except AttributeError:
pass

which seems to work, at least with GtkAgg (I didn't venture to find out
why the AttributeError is raised, it works in spite of that).

Would it make sense to have that shortcut by default (and working for all
windowing backends)?

Georg

-- 
Thus spake the Lord: Thou shalt indent with four spaces. No more, no less.
Four shall be the number of spaces thou shalt indent, and the number of thy
indenting shall be four. Eight shalt thou not indent, nor either indent thou
two, excepting that thou then proceed to four. Tabs are right out.


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] default "q" shortcut?

2009-10-21 Thread Gael Varoquaux
On Wed, Oct 21, 2009 at 09:23:54AM +0200, Georg Brandl wrote:
> Hi,

> one thing I missed when I switched from Gnuplot to matplotlib was that I
> can't press "q" to close a window but have to use the window manager; in
> one environment I work in that means I have to use the mouse to close a
> window.

I am +1 on that feature request. I don't have time to code it, though
:).

Gaël

--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Problem with negative numbers in EPS files

2009-10-21 Thread Thomas Robitaille

Hi,

Running the simple attached test.py script creates a very simple  
test.eps. Converting this to a pdf file with ps2pdf causes the  
negative numbers to disappear (except the minus sign). Of course, the  
PDF backend can be used from the start, but there are situations (e.g.  
typesetting with LaTeX where one needs to include an EPS file, and the  
final document will be a PDF file, in which case the negative numbers  
disappear during the conversion). I have submitted a bug report:


https://sourceforge.net/tracker/?func=detail&aid=2883256&group_id=80706&atid=560720

Cheers,

Tom

import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as mpl
fig = mpl.figure()
ax = fig.add_subplot(111)
ax.set_xlim(-100.,100.)
ax.set_ylim(-100.,100.)
fig.savefig('test.eps')




--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Problem with negative numbers in EPS files

2009-10-21 Thread Michael Droettboom
See my feedback in the bug report.

Mike

Thomas Robitaille wrote:
> Hi,
>
> Running the simple attached test.py script creates a very simple 
> test.eps. Converting this to a pdf file with ps2pdf causes the 
> negative numbers to disappear (except the minus sign). Of course, the 
> PDF backend can be used from the start, but there are situations (e.g. 
> typesetting with LaTeX where one needs to include an EPS file, and the 
> final document will be a PDF file, in which case the negative numbers 
> disappear during the conversion). I have submitted a bug report:
>
> https://sourceforge.net/tracker/?func=detail&aid=2883256&group_id=80706&atid=560720
>  
>
>
> Cheers,
>
> Tom
>
> 
>
>
>
>
>
>
>
> 
>
> --
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> 
>
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

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


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] error with basemap and pdf

2009-10-21 Thread Jouni K . Seppänen
Could somebody test that script with current trunk (rev. 7899)? I don't
have basemap installed, but I think my latest change might shake out the
bug.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] error with basemap and pdf

2009-10-21 Thread Jeff Whitaker
Jouni K. Seppänen wrote:
> Could somebody test that script with current trunk (rev. 7899)? I don't
> have basemap installed, but I think my latest change might shake out the
> bug.
>
>   
Jouni:  That test script now crashes with:

Traceback (most recent call last):
  File "testpdf.py", line 28, in 
savefig('testfig.pdf')
  File "/Users/jwhitaker/lib/python/matplotlib/pyplot.py", line 355, in 
savefig
return fig.savefig(*args, **kwargs)
  File "/Users/jwhitaker/lib/python/matplotlib/figure.py", line 1055, in 
savefig
self.canvas.print_figure(*args, **kwargs)
  File "/Users/jwhitaker/lib/python/matplotlib/backend_bases.py", line 
1618, in print_figure
**kwargs)
  File "/Users/jwhitaker/lib/python/matplotlib/backend_bases.py", line 
1476, in print_pdf
return pdf.print_pdf(*args, **kwargs)
  File "/Users/jwhitaker/lib/python/matplotlib/backends/backend_pdf.py", 
line 2094, in print_pdf
self.figure.draw(renderer)
  File "/Users/jwhitaker/lib/python/matplotlib/artist.py", line 55, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/Users/jwhitaker/lib/python/matplotlib/figure.py", line 772, in draw
for a in self.axes: a.draw(renderer)
  File "/Users/jwhitaker/lib/python/matplotlib/artist.py", line 55, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/Users/jwhitaker/lib/python/matplotlib/axes.py", line 1761, in draw
a.draw(renderer)
  File "/Users/jwhitaker/lib/python/matplotlib/artist.py", line 55, in 
draw_wrapper
draw(artist, renderer, *kl)
  File "/Users/jwhitaker/lib/python/matplotlib/lines.py", line 533, in draw
drawFunc(renderer, gc, tpath, affine.frozen())
  File "/Users/jwhitaker/lib/python/matplotlib/lines.py", line 869, in 
_draw_lines
self._lineFunc(renderer, gc, path, trans)
  File "/Users/jwhitaker/lib/python/matplotlib/lines.py", line 920, in 
_draw_dashed
renderer.draw_path(gc, path, trans)
  File "/Users/jwhitaker/lib/python/matplotlib/backends/backend_pdf.py", 
line 1353, in draw_path
rgbFace is None and gc.get_hatch_path() is None)
  File "/Users/jwhitaker/lib/python/matplotlib/backends/backend_pdf.py", 
line 1235, in writePath
cmds = self.pathOperations(path, transform, clip)
  File "/Users/jwhitaker/lib/python/matplotlib/backends/backend_pdf.py", 
line 1214, in pathOperations
raise ValueError, 'Path lacks initial MOVETO'
ValueError: Path lacks initial MOVETO

-- 
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



--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Should Path objects have an initial MOVETO? (was: error with basemap and pdf)

2009-10-21 Thread Jouni K . Seppänen
Jeff Whitaker  writes:

> Jouni:  That test script now crashes with:
>
>   File "/Users/jwhitaker/lib/python/matplotlib/backends/backend_pdf.py", 
> line 1214, in pathOperations
> raise ValueError, 'Path lacks initial MOVETO'
> ValueError: Path lacks initial MOVETO

I think this confirms my suspicion that the bug is really elsewhere. A
path in PDF needs to begin with a "m" that sets the initial point, and
that particular Path object only consisted of one LINETO operation. Am I
correct in thinking that this is an invalid path?

I'm not too familiar with Path (and I'm terribly busy today) but I think
the way to catch this bug is to add a sanity check to Path, similar to
the check in the pdf backend that produces that error. Then the
traceback would show what code is creating the invalid path -- the
traceback from the backend is too late in the execution to tell us that.

-- 
Jouni K. Seppänen
http://www.iki.fi/jks


--
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel