You can subscribe to this list here.
| 2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
(33) |
Dec
(20) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2004 |
Jan
(7) |
Feb
(44) |
Mar
(51) |
Apr
(43) |
May
(43) |
Jun
(36) |
Jul
(61) |
Aug
(44) |
Sep
(25) |
Oct
(82) |
Nov
(97) |
Dec
(47) |
| 2005 |
Jan
(77) |
Feb
(143) |
Mar
(42) |
Apr
(31) |
May
(93) |
Jun
(93) |
Jul
(35) |
Aug
(78) |
Sep
(56) |
Oct
(44) |
Nov
(72) |
Dec
(75) |
| 2006 |
Jan
(116) |
Feb
(99) |
Mar
(181) |
Apr
(171) |
May
(112) |
Jun
(86) |
Jul
(91) |
Aug
(111) |
Sep
(77) |
Oct
(72) |
Nov
(57) |
Dec
(51) |
| 2007 |
Jan
(64) |
Feb
(116) |
Mar
(70) |
Apr
(74) |
May
(53) |
Jun
(40) |
Jul
(519) |
Aug
(151) |
Sep
(132) |
Oct
(74) |
Nov
(282) |
Dec
(190) |
| 2008 |
Jan
(141) |
Feb
(67) |
Mar
(69) |
Apr
(96) |
May
(227) |
Jun
(404) |
Jul
(399) |
Aug
(96) |
Sep
(120) |
Oct
(205) |
Nov
(126) |
Dec
(261) |
| 2009 |
Jan
(136) |
Feb
(136) |
Mar
(119) |
Apr
(124) |
May
(155) |
Jun
(98) |
Jul
(136) |
Aug
(292) |
Sep
(174) |
Oct
(126) |
Nov
(126) |
Dec
(79) |
| 2010 |
Jan
(109) |
Feb
(83) |
Mar
(139) |
Apr
(91) |
May
(79) |
Jun
(164) |
Jul
(184) |
Aug
(146) |
Sep
(163) |
Oct
(128) |
Nov
(70) |
Dec
(73) |
| 2011 |
Jan
(235) |
Feb
(165) |
Mar
(147) |
Apr
(86) |
May
(74) |
Jun
(118) |
Jul
(65) |
Aug
(75) |
Sep
(162) |
Oct
(94) |
Nov
(48) |
Dec
(44) |
| 2012 |
Jan
(49) |
Feb
(40) |
Mar
(88) |
Apr
(35) |
May
(52) |
Jun
(69) |
Jul
(90) |
Aug
(123) |
Sep
(112) |
Oct
(120) |
Nov
(105) |
Dec
(116) |
| 2013 |
Jan
(76) |
Feb
(26) |
Mar
(78) |
Apr
(43) |
May
(61) |
Jun
(53) |
Jul
(147) |
Aug
(85) |
Sep
(83) |
Oct
(122) |
Nov
(18) |
Dec
(27) |
| 2014 |
Jan
(58) |
Feb
(25) |
Mar
(49) |
Apr
(17) |
May
(29) |
Jun
(39) |
Jul
(53) |
Aug
(52) |
Sep
(35) |
Oct
(47) |
Nov
(110) |
Dec
(27) |
| 2015 |
Jan
(50) |
Feb
(93) |
Mar
(96) |
Apr
(30) |
May
(55) |
Jun
(83) |
Jul
(44) |
Aug
(8) |
Sep
(5) |
Oct
|
Nov
(1) |
Dec
(1) |
| 2016 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
(3) |
Sep
(1) |
Oct
(3) |
Nov
|
Dec
|
| 2017 |
Jan
|
Feb
(5) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(3) |
Aug
|
Sep
(7) |
Oct
|
Nov
|
Dec
|
| 2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(2) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: Darren D. <dd...@co...> - 2006-08-20 14:57:18
|
Hi Edin, On Sunday 20 August 2006 10:21 am, Edin Salkovi=C4=87 wrote: > The SoC deadline (for code) is tommorow (Aug 21st.), so I decided to comm= it > what I have done till now to the repository. > > JDH is going on a vacation and will not be able to review it for at > least a week, > but I had to commit it before 21st. Aug - that's the SoC rules. Hopefully, > I'll be adding new stuff the next week (and after), but that doesn't > count as part of SoC anymore... > > Since this is my first commit, can anyone please test it. I tested it > only on my windows box. > > I changed > __init__.py, > mathtext.py > CHANGELOG > > I added > mathtext2.py > mathtext2_demo.py > > Anyone who wants to test the new mathtext2 has to add the following line(= s) > to the matplotlibrc (mathtext2 is disabled by default): > > mathtext2: True # Needed to enable the new mathtext > > # Font lines, feel free to change or uncomment (BaKoMa is used by default) > mathtext.rm : FreeSerif.ttf > mathtext.it : FreeSerifItalic.ttf # Text italic > mathtext.tt : FreeMono.ttf # Typewriter (monospaced) > mathtext.mit : FreeSerifItalic.ttf # Math italic > mathtext.cal : FreeSansOblique.ttf # Caligraphic > mathtext.nonascii: FreeSerif.ttf # Used for \sum, \infty etc. > > The FreeFont fonts (or any other for that matter) have to be downloaded a= nd > put into the mpl-data dir. The default settingsuse the current bakoma > fonts, and they play pretty well with FreeSerif.ttf as the nonascii > (unicode) font. > > so I recommend you just put the line > mathtext.nonascii: FreeSerif.ttf > > and comment out the rest (experiment a little with fonts). > > Tonight I plan to add support for fractions. Beware that the only > supported backend for now is Agg. > > mathtext2_demo.py is attached I just updated my svn repository, added the lines you indicated to my rc fi= le,=20 but when I run the example, mpl can't find the freefonts that I already hav= e=20 installed on my system. The freefonts I have installed are not ttf, but pfb= =2E=20 Where should we download from? ftp://ftp.cs.umn.edu/pub/gimp/pub/gimp/fonts= ,=20 for example? I dont think those are what I am looking for. Do they really=20 need to go in mpl-dir? It would be more appropriate if they could be=20 installed somewhere like /usr/share/fonts. |
|
From: <edi...@gm...> - 2006-08-20 14:25:51
|
SGVyZSBhcmUgdGhlIHJlYXNvbnMgZm9yIHJld3JpdGluZyBtYXRodGV4dDIgdGhhdCBJIGNhbiBj b21lIHVwIHdpdGg6CgogKiBPbmUgb2YgdGhlIHJlYXNvbnMgSSBzdGFydGVkIHRoZSBjb21wbGV0 ZSByZXdyaXRlIG9mIHRoZSBwYXJzZXIgaXMgdGhhdApJJ20gYSBuZXdiaWUgYXQgcGFyc2luZywg YW5kIEkgd2FudGVkIHRvIHRyeSBpdCBvdXQgYSBiaXQuIEkgZGlkbid0IHVuZGVyc3RhbmQKd2h5 IHdhcyBpdCBzbyBkaWZmaWN1bHQgdG8gcGFyc2U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5cyBwb2ludCB0aGUgdXNlciB0 byBhIHdlYiBzaXRlIGFuZCB0aGV5IGNhbiBkb3dubG9hZCB0aGVtCj4gZnJvbS4KPgo+ICAgICBF ZGluPiBUaGUgbmV3IG1hdGh0ZXh0LnB5IGlzIGF0dGFjaGVkLiBQbGVhc2UgZG8gbm90IHRyeSBp dCBhdAo+ICAgICBFZGluPiBob21lIDspIGJlY2F1c2Ugbm90aGluZyB2aXNpYmxlIHlldCB3b3Jr cy4KPgo+IE9LLgo+Cj4gSkRICj4K |
|
From: <edi...@gm...> - 2006-08-20 14:21:19
|
The SoC deadline (for code) is tommorow (Aug 21st.), so I decided to commit what I have done till now to the repository. JDH is going on a vacation and will not be able to review it for at least a week, but I had to commit it before 21st. Aug - that's the SoC rules. Hopefully, I'll be adding new stuff the next week (and after), but that doesn't count as part of SoC anymore... Since this is my first commit, can anyone please test it. I tested it only on my windows box. I changed __init__.py, mathtext.py CHANGELOG I added mathtext2.py mathtext2_demo.py Anyone who wants to test the new mathtext2 has to add the following line(s) to the matplotlibrc (mathtext2 is disabled by default): mathtext2: True # Needed to enable the new mathtext # Font lines, feel free to change or uncomment (BaKoMa is used by default) mathtext.rm : FreeSerif.ttf mathtext.it : FreeSerifItalic.ttf # Text italic mathtext.tt : FreeMono.ttf # Typewriter (monospaced) mathtext.mit : FreeSerifItalic.ttf # Math italic mathtext.cal : FreeSansOblique.ttf # Caligraphic mathtext.nonascii: FreeSerif.ttf # Used for \sum, \infty etc. The FreeFont fonts (or any other for that matter) have to be downloaded and put into the mpl-data dir. The default settingsuse the current bakoma fonts, and they play pretty well with FreeSerif.ttf as the nonascii (unicode) font. so I recommend you just put the line mathtext.nonascii: FreeSerif.ttf and comment out the rest (experiment a little with fonts). Tonight I plan to add support for fractions. Beware that the only supported backend for now is Agg. mathtext2_demo.py is attached |
|
From: Christopher B. <Chr...@no...> - 2006-08-18 23:14:57
|
As a probably final installment in the thread about optimizing the wx
back-end, here is a post from the wxPython list, in which someone posted
SWIG code for making a PyBuffer from his data set, then using it to
create a wx.Image without copying. A similar approach could be used for
the wxAgg back-end.
-Chris
-------- Original Message --------
Subject: [wxPython-users] Re: using wxImage in C++ python extension
Date: Fri, 18 Aug 2006 16:48:08 +0000 (UTC)
From: Andrew Murray <and...@st...>
Reply-To: wxP...@li...
To: wxp...@li...
References: <200...@uc...>
<44E...@al...> <200...@uc...>
<44E...@no...> <44E...@al...>
<44E...@no...>
Hi all :)
I've followed the combined advice of Robin and Christopher in using a python
buffer object to instance a wx.Image in the python wrapper layer. It
all seems
to be working - and I don't think there are any 'data copies' going on ;)
To keep my underlying C++ python-free, I introduced the buffer (and
creation of
the wx.Image) via my .i Swig file. In case anyone who is reading is
keen trying
to solve a similar problem, I've included the code that I added to my .i
file in
order to implement the change below. (I'd appreciate any comments regarding
errors or shortcomings that anyone spots in my implementation.)
Sorry I didn't reply to the thread earlier. A combination of being tied
up with
more boring work, moving house and background research into using python
buffers
with Swig means that I've only just got this far.
One remaining question I have is: Does the call to wx.EmptyImage that I make
cause any memory to be allocated? I see from Robin's recent post that in my
case this call is now redundant (as I will soon be using
ImageFromBuffer) - but
I'm curious to know the answer anyway ;)
Thanks for all the help. The more I use wxPython the more I like it...
Andrew ;)
/* the RawImage C++ class that we are wrapping offers a method that
returns a pointer to an internal 'unsigned char' buffer of display
data. To make the python class generated by SWIG a bit more
friendly to the rest of our wxPython code we instruct SWIG to make
two modifications during the wrapping process. First we add a
method to the C++ class that will return a version of the internal
display buffer wrapped up as a 'python buffer object' (performing
this in the C++ wrapper class keeps the wrapped C++ python-free)...
*/
%extend RawImage {
PyObject* RawImage::getDisplayBuffer(void) {
// return a new 'python buffer object' that intialised using
// the memory address and length of our display buffer...
void* pvBufferData = (void*)self->pcGetDisplayData();
int iBufferSize = self->getDisplayBufferSize();
return PyBuffer_FromMemory(pvBufferData, iBufferSize);
}
}
/* ... we also add a method to the python wrapper class that will use
the buffer offered by our new C++ method to create a wx.Image
(neither of these methods actually copies the image data)...
*/
%extend RawImage {
%pythoncode %{
def getImage(self):
# create an unintialised wx.Image of the correct size...
wximage = wx.EmptyImage(self.getWidth(), self.getHeight(), clear=False)
# then define the data content of the image...
wximage.SetDataBuffer(self.getDisplayBuffer())
return wximage
%}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: wxP...@li...
For additional commands, e-mail: wxP...@li...
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: John H. <jdh...@ac...> - 2006-08-18 16:43:29
|
>>>>> "Edin" =3D=3D Edin Salkovi=A7 <edi...@gm...> writes:
Edin> Hi all, Please John, take some time before SciPy conf to
Edin> answer at least some of this questions, because the SoC
Edin> deadline (21st August) is *very* near.
Alas, I am already here and have been a little out of email contact
while traveling. Sorry for the delay.
Edin> 1) I'm having some problems regarding FT2Font. The problem
Edin> is when I instantiate FT2Font like: font =3D FT2Font(filename)
Edin> and when I call it's method font.set_text("Some text"), and
Edin> afterwards, font.draw_glyphs_to_bitmap(), the latter simply
Edin> deletes every glyph that was drawn before it, and just
Edin> paints in the internal image buffer the text that was passed
Edin> on last invocation of set_text (or load_char).
This is a feature, not a bug :-) You can clear the image buffer if
you want with the clear method, as we do in the mathtexy code
for fontface in self.fonts.values():
fontface.clear()
Edin> This is a pain, because draw_glyphs_to_bitmap implements the
Edin> layout (with kerning etc.), but if one wants to paint
Edin> several words in different x,y positions in the same image
Edin> buffer, he has to do the layout for every character in every
Edin> word manually via draw_glyph_to_bitmap(x, y, glyph) (like
Edin> you did with the BaKoMa fonts in mathtext).
Edin> Why hasn't draw_glyphs_to_bitmap been implemented so that it
Edin> takes x, y as arguments (draw_glyphs_to_bitmap(x, y)) and
Edin> leaves the image buffer intact (as does
Edin> draw_glyph_to_bitmap)?
You can add optional x and y args to draw_glyphs_to_bitmap if you need
them. Just make sure any changes you make pass
examples/backend_driver.py and unit/memleak_hawaii3.py
Edin> 2) As I have said before, I have started the complete
Edin> rewrite of mathtext (the parsing stuff etc.). I have
Edin> completely removed the dependency on pyparsing (please don't
Edin> yell at me :), and I was wondering about how much of TeX
OK, I won't yell. Quietly scold maybe :-)
I am skeptical of your -- or anyone's except Robert's -- ability to
parse TeX mathematical expressions w/o a true recursive descent
parser. I took a look at your code but w/o any running examples I
could not test it. From reading it, I do not think it will be able to
handle the deeply recursive structures that are currently supported by
the existing, working parser. Can you handle recursively nested
super/sub scripts? Can it parse this
tex =3D r'$\cal{R}\prod_{i=3D\alpha_{i+1}}^\infty a_i\rm{sin}(2 \pi f x=
_i)$'
If so, I apologize for my skepticism, but my working assumption is you
will need a proper parser to parse tex and string methods aren't going
to get you there. What I really need to see before even considering a
system that replaces the working system is an argument about why it
needs to be replaced, and more importantly, code that can do
everything the old code can do, such as render the mathtext_demo.py
example? =20
Edin> should mathtext support. I'm not talking about support for
Edin> \frac, \above, \choose (which I plan to add one by one)
Edin> etc., but about more general things - macros (\def etc.). I
\above, \frac and \sqrt yes, \def no. Others I'm not sure about. =20
Edin> was thinking of just simulating them, at least to a
Edin> tolerable extent, via notion of an enviroment. Example: \rm
Edin> in plain TeX sets the current font to roman (until the end
Edin> of the current scope - 'till it hits "}"). Implementation:
Edin> At render time, when the parser hits "\rm", it does the
Edin> folowing: env["facetype"] =3D "rm", where env is the
Edin> environment in the current scope.
Can we use classes here rather than dictionaries? Syntactically, I
prefer env.facetype =3D "rm" to the dictionary syntax.
Edin> Also, I am planing to create a separate class for every new
Edin> layout item that gets implemented. Example:
Edin> sub/superscripted item (nucleus_sub^sup) gets translated to
Edin> an instance of class Scripted that has the attributes
Edin> nucleus, superscript and subscript.
Edin> 3) I was thinking of focusing on just the Agg backend for
Edin> now (that is till' the deadline). Is this OK? 4) I think
Edin> that we should move the job of math_parse_s_ft2font,
Edin> math_parse_s_ft2font_svg, and math_parse_s_ps etc. to the
Edin> corresponding backends, and that some general function like:
Edin> math_parse_s(x, y, s, prop, angle) should be implemented
Edin> directly in mathtext.py (perhaps even without the "angle"
Edin> parameter) so that it returns a list of the following type:
Edin> [(x1, y1, s1, prop1, angle1), ... , (xn, yn, sn, propn,
Edin> anglen)]
I can't address these questions until I understand why you are trying
to rewrite, rather than extend or fix, the existing code. The agg and
the postscript backends work with the existing frameowork. As far as
I can see, you could fix the layout engine in the existing framework
and not have to think too much about backends, with the exception that
you need a basic backend line drawing API for things like the
horizontal line in \frac.
Edin> 5) What would be the consequences of distributing a GPL font
Edin> (FreeFont) with matplotlib. I mean, it's not that using a
Edin> GPL font in some non-GPL app could be a breach of the
Edin> GPL. Is there any interest in this?
Don't underestimate the zealousness of GPL advocates. I have been
informed by the FSF that merely providing a backend that does=20
import qt
in a backend that is optionally included at runtime by a user who may
be using a GPL version of QT or may be using a commercially licensed
version of qt (we can't know which) makes the entire code base of mpl
GPL'd. This claim was provided w/o argument and I frankly find it
ludicrous. Robert can probably tell you the IANAL response to
including GPL'd fonts but I'm not too interested in distributing them.
We can always point the user to a web site and they can download them
from.
Edin> The new mathtext.py is attached. Please do not try it at
Edin> home ;) because nothing visible yet works.
OK.
JDH
|
|
From: Christopher B. <Chr...@no...> - 2006-08-18 05:21:00
|
Charlie Moad wrote:
> I'll paste the block of interest to save
> you a little digging.
>
> bbox = self.replot
> w, h = int(bbox.width()), int(bbox.height())
> l, t = bbox.ll().x().get(), bbox.ur().y().get()
> reg = self.copy_from_bbox(bbox)
So this is one copy.
> stringBuffer = reg.to_string()
Is this another? or does to_string not copy?
> qImage = qt.QImage(stringBuffer, w, h, 32, None, 0,
> qt.QImage.IgnoreEndian)
Here we have difference from wx -- AFAICT, a wx.Image doesn't do rgba32,
it does RGB24, with a separate 8bit alpha channel. if to_string copies
anyway, then that wouldn't make much difference.
But do we really need alpha here anyway?
> self.pixmap.convertFromImage(qImage, qt.QPixmap.Color)
> p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap)
And this looks like wx.
I wish I had more time to work on this, but I'm in a crunch that I'll be
in for while....
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Christopher B. <Chr...@no...> - 2006-08-18 05:16:36
|
Darren Dale wrote:
> I think all the high rollers are at SciPy 2006.
Oh right. This is the third year in a row that I have ALMOST gone
myself. Maybe next year.
But what's the deal? Aren't they all hooked up to wifi and checking
email constantly?
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: Charlie M. <cw...@gm...> - 2006-08-18 00:46:07
|
On 8/17/06, Christopher Barker <Chr...@no...> wrote:
> Hi all,
>
> I seem to be talking to myself here, but if someone (including myself)
> wants to pick this up in the future, it'll be good to have it in the
> archives.
>
> Christopher Barker wrote:
> >> There is also the
> >> wx.Image.SetDataBuffer method, which will have the wxImage use the
> >> buffer passed in without making a copy, but if the buffer doesn't
> >> live as long as the image does it will likely cause a crash.
> >
> > This would probably be the easiest way to get top performance at the
> > moment. If we can make the Agg data a buffer, and somehow do the
> > reference counting right so it doesn't get deleted while the wxImage is
> > still around (that may not be hard -- the wxImage has to be converted to
> > a wxBitmap to be drawn anyway)
>
> I've been suing this for another use, and Robin just added an improved
> version of new wx.Image factory function I wrote for just this purpose:
>
> def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
> """
> Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
> parameter must be a Python object that implements the buffer
> interface, such as a string, array, etc. The dataBuffer object is
> expected to contain a series of RGB bytes and be width*height*3
> bytes long. A buffer object can optionally be supplied for the
> image's alpha channel data, and it is expected to be width*height
> bytes long.
>
> A reference to the data and alpha buffer objects are kept with the
> wx.Image, so that they won't get deleted until after the wx.Image
> is deleted. However please be aware that it is not guaranteed that
> an object won't move its memory buffer to a new location when it
> needs to resize its contents. If that happens then the wx.Image
> will end up referring to an invalid memory location and could cause
> the application to crash. Therefore care should be taken to not
> manipulate the objects used for the data and alpha buffers in a
> way that would cause them to change size.
> """
> image = wx.EmptyImage(width, height)
> image.SetDataBuffer(dataBuffer)
> if alphaBuffer is not None:
> image.SetAlphaBuffer(alphaBuffer)
> image._buffer = dataBuffer
> image._alpha = alphaBuffer
> return image
>
> Does the aggDrawer already implement a Python buffer object? If so,
> using this would be easy. If not, then it probably should, unless we go
> straight to the numpy array protocol.
I haven't had time to thoroughly absorb all your post. From skimming
it looks like we could do a similar approach as the qtagg blitting.
If you look at the else clause in the FigureCanvasQTAgg.paintEvent
method, you'll see we added a to_string method to the BufferRegion
object. Using this string buffer we create a QImage and blit it. It
includes the alpha channel. I'll paste the block of interest to save
you a little digging.
bbox = self.replot
w, h = int(bbox.width()), int(bbox.height())
l, t = bbox.ll().x().get(), bbox.ur().y().get()
reg = self.copy_from_bbox(bbox)
stringBuffer = reg.to_string()
qImage = qt.QImage(stringBuffer, w, h, 32, None, 0,
qt.QImage.IgnoreEndian)
self.pixmap.convertFromImage(qImage, qt.QPixmap.Color)
p.drawPixmap(qt.QPoint(l, self.renderer.height-t), self.pixmap)
- Charlie
|
|
From: Darren D. <dd...@co...> - 2006-08-18 00:15:25
|
On Thursday 17 August 2006 7:19 pm, Christopher Barker wrote: > I seem to be talking to myself here I think all the high rollers are at SciPy 2006. |
|
From: Christopher B. <Chr...@no...> - 2006-08-17 23:19:12
|
Hi all,
I seem to be talking to myself here, but if someone (including myself)
wants to pick this up in the future, it'll be good to have it in the
archives.
Christopher Barker wrote:
>> There is also the
>> wx.Image.SetDataBuffer method, which will have the wxImage use the
>> buffer passed in without making a copy, but if the buffer doesn't
>> live as long as the image does it will likely cause a crash.
>
> This would probably be the easiest way to get top performance at the
> moment. If we can make the Agg data a buffer, and somehow do the
> reference counting right so it doesn't get deleted while the wxImage is
> still around (that may not be hard -- the wxImage has to be converted to
> a wxBitmap to be drawn anyway)
I've been suing this for another use, and Robin just added an improved
version of new wx.Image factory function I wrote for just this purpose:
def ImageFromBuffer(width, height, dataBuffer, alphaBuffer=None):
"""
Creates a `wx.Image` from the data in dataBuffer. The dataBuffer
parameter must be a Python object that implements the buffer
interface, such as a string, array, etc. The dataBuffer object is
expected to contain a series of RGB bytes and be width*height*3
bytes long. A buffer object can optionally be supplied for the
image's alpha channel data, and it is expected to be width*height
bytes long.
A reference to the data and alpha buffer objects are kept with the
wx.Image, so that they won't get deleted until after the wx.Image
is deleted. However please be aware that it is not guaranteed that
an object won't move its memory buffer to a new location when it
needs to resize its contents. If that happens then the wx.Image
will end up referring to an invalid memory location and could cause
the application to crash. Therefore care should be taken to not
manipulate the objects used for the data and alpha buffers in a
way that would cause them to change size.
"""
image = wx.EmptyImage(width, height)
image.SetDataBuffer(dataBuffer)
if alphaBuffer is not None:
image.SetAlphaBuffer(alphaBuffer)
image._buffer = dataBuffer
image._alpha = alphaBuffer
return image
Does the aggDrawer already implement a Python buffer object? If so,
using this would be easy. If not, then it probably should, unless we go
straight to the numpy array protocol.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: <edi...@gm...> - 2006-08-15 21:53:15
|
Hi all,
Please John, take some time before SciPy conf to answer at least some of
this questions, because the SoC deadline (21st August) is *very* near.
1) I'm having some problems regarding FT2Font.
The problem is when I instantiate FT2Font like:
font = FT2Font(filename)
and when I call it's method font.set_text("Some text"), and afterwards,
font.draw_glyphs_to_bitmap(), the latter simply deletes every glyph that
was drawn before it, and just paints in the internal image buffer the
text that was passed on last invocation of set_text (or load_char).
This is a pain, because draw_glyphs_to_bitmap implements the layout
(with kerning etc.), but if one wants to paint several words in different
x,y positions in the same image buffer, he has to do the layout for every
character in every word manually via draw_glyph_to_bitmap(x, y, glyph)
(like you did with the BaKoMa fonts in mathtext).
Why hasn't draw_glyphs_to_bitmap been implemented so that it takes x, y as
arguments (draw_glyphs_to_bitmap(x, y)) and leaves the image
buffer intact (as does draw_glyph_to_bitmap)?
2) As I have said before, I have started the complete rewrite of mathtext
(the parsing stuff etc.). I have completely removed the dependency on
pyparsing (please don't yell at me :), and I was wondering about how much
of TeX should mathtext support. I'm not talking about support for \frac,
\above, \choose (which I plan to add one by one) etc., but about more
general things - macros (\def etc.). I was thinking of just simulating
them, at least to a tolerable extent, via notion of an enviroment.
Example:
\rm in plain TeX sets the current font to roman (until the end of the
current scope - 'till it hits "}").
Implementation:
At render time, when the parser hits "\rm", it does the folowing:
env["facetype"] = "rm", where env is the environment in the current scope.
Also, I am planing to create a separate class for every new layout item
that gets implemented.
Example: sub/superscripted item (nucleus_sub^sup) gets translated to an
instance of class Scripted that has the attributes nucleus, superscript
and subscript.
3) I was thinking of focusing on just the Agg backend for now (that is
till' the deadline). Is this OK?
4) I think that we should move the job of
math_parse_s_ft2font, math_parse_s_ft2font_svg, and math_parse_s_ps etc.
to the corresponding backends, and that some general function like:
math_parse_s(x, y, s, prop, angle)
should be implemented directly in mathtext.py (perhaps even without the
"angle" parameter) so that it returns a list of the following type:
[(x1, y1, s1, prop1, angle1), ... , (xn, yn, sn, propn, anglen)]
Then the backend should call draw_text for every item in the list.
Something like
def draw_mathtext(self, gc, x, y, s, prop, angle):
items = math_parse_s(x, y, s, prop, angle)
for item in items:
draw_text(*items)
instead of current:
def draw_mathtext(self, gc, x, y, s, prop, angle):
"""
Draw the math text using matplotlib.mathtext
"""
if __debug__: verbose.report('RendererAgg.draw_mathtext',
'debug-annoying')
size = prop.get_size_in_points()
width, height, fonts = math_parse_s_ft2font(
s, self.dpi.get(), size, angle)
if angle == 90:
width, height = height, width
for font in fonts:
if angle == 90:
font.horiz_image_to_vert_image() # <-- Rotate
self._renderer.draw_text( font, int(x)-width, int(y)-height, gc)
else:
self._renderer.draw_text( font, int(x), int(y)-height, gc)
if 0:
self._renderer.draw_rectangle(gc, None,
int(x),
self.height-int(y),
width, height)
Is this possible? I'm aware of overseeing the dpi and fontsize arguments,
but I don't think that this is much of an issue.
5) What would be the consequences of distributing a GPL font (FreeFont)
with matplotlib. I mean, it's not that using a GPL font in some non-GPL
app could be a breach of the GPL. Is there any interest in this?
The new mathtext.py is attached. Please do not try it at home ;)
because nothing visible yet works.
Cheers,
Edin
|
|
From: Darren D. <dd...@co...> - 2006-08-15 20:54:07
|
On Tuesday 15 August 2006 12:32, John Hunter wrote: > >>>>> "Darren" == Darren Dale <dd...@co...> writes: > > Darren> When I run the following: figure(); plot([1,2]) figure(); > Darren> plot([1,2]) > > Darren> and then I use the zoom widget in one figure, and then try > Darren> to use the zoom widget in the other figure without turning > Darren> off the first zoom widget, I get an error. Is this > Darren> desirable? > > Hi Darren -- I just modified the code to use per canvas widget > locking. Now every FigureCanvas has a widgetlock attr. > Unfortunately, I cannot adequately test right now because I am working > over X11 and the interactive widget stuff like examples/lasso_demo.py > is too slow. Could you try that demo, as well as multiple figures > with pan/zoom and make sure you don't see any strangness? Looks good to me, no problems to report. |
|
From: Christopher B. <Chr...@no...> - 2006-08-15 18:05:43
|
I moved this to the devel list -- that seemed more appropriate.
Stefan van der Walt wrote:
> On Mon, Aug 14, 2006 at 11:12:29AM -0700, Christopher Barker wrote:
>> Another (or additional) option is for both MPL and wx to support
>> the new array interface protocol in numpy.
>> Travis posted a patch to PIL for support a while back, I don't know
>> if it's going to get applied or not, but it's worth looking at.
>
> Looks like it has been added already.
Very cool. Now we just need MPL and wx to support it...
In the meantime, this note from Robin Dunn on the wxpython-users list:
> wx.Image.SetData makes a copy and gives ownership of the copy to the
> image. This allows it to work even when the source buffer doesn't
> live as long as the image does.
This is probably how the original wx back-end worked.
> There is also the
> wx.Image.SetDataBuffer method, which will have the wxImage use the
> buffer passed in without making a copy, but if the buffer doesn't
> live as long as the image does it will likely cause a crash.
This would probably be the easiest way to get top performance at the
moment. If we can make the Agg data a buffer, and somehow do the
reference counting right so it doesn't get deleted while the wxImage is
still around (that may not be hard -- the wxImage has to be converted to
a wxBitmap to be drawn anyway)
Another issue is the data layout of the Agg buffer: is it RGB or RGBA
(or something else?) wxImage requires 24bit RGB. It can support an alpha
channel, but as far as I can tell, the alpha data is stored in a
separate array, rather than as an RGBA array.
I'm poking into the code a bit now, and see:
def _py_convert_agg_to_wx_image(agg, bbox):
image = wx.EmptyImage(int(agg.width), int(agg.height))
image.SetData(agg.tostring_rgb())
We might be able to just change that to:
image.SetDataBuffer(agg.tostring_rgb())
Does the agg.tostring_rgb() call make a copy?
If so, then maybe a agg.Getbuffer() method is in order.
Also, if it does, then that string will get garbage collected right
away, and delete the memory buffer. We'd need to keep that around
somehow. maybe a subclass of wx.Image that holds a reference to the
string. Then they'll both get deleted when the wx.Image is deleted..
I also took a look at:
def _clipped_image_as_bitmap(
This is way too ugly!
1) maybe it would be a good idea to have a:
agg.subImageToString_rgb(x,y,w,h)
This must be used in all the back-ends
2) If you do need to do the sub-sampling with wx code, I think you could do:
def _clipped_image_as_bitmap(image, bbox):
"""
Convert the region of a wx.Image described by bbox to a wx.Bitmap.
"""
l, b, width, height = bbox.get_bounds()
r = l + width
t = b + height
subImage = image.GetSubImage( wx.Rect( (l,b),(width,height) ) )
destBmp = wx.BitmapFromImage(subImage)
return destBmp
Much simpler (and probably faster)
3) Another option would be to use numpy arrays to pass this kind of data
around. We could then use numpy to sub-sample the image. MPL depends on
numpy anyway, so it's not an added dependency. That may have to wait
until the 'grand unification" is complete, and we can drop support for
Numeric and numarray.
Sorry I don't have time to build and test this code right now.
-Chris
--
Christopher Barker, Ph.D.
Oceanographer
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
|
|
From: John H. <jdh...@ac...> - 2006-08-15 16:43:59
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
Darren> When I run the following: figure(); plot([1,2]) figure();
Darren> plot([1,2])
Darren> and then I use the zoom widget in one figure, and then try
Darren> to use the zoom widget in the other figure without turning
Darren> off the first zoom widget, I get an error. Is this
Darren> desirable?
Hi Darren -- I just modified the code to use per canvas widget
locking. Now every FigureCanvas has a widgetlock attr.
Unfortunately, I cannot adequately test right now because I am working
over X11 and the interactive widget stuff like examples/lasso_demo.py
is too slow. Could you try that demo, as well as multiple figures
with pan/zoom and make sure you don't see any strangness?
Thanks,
JDH
|
|
From: John H. <jdh...@ac...> - 2006-08-15 14:14:24
|
>>>>> "Asheesh" == Asheesh Laroia <as...@as...> writes:
Asheesh> On Mon, 14 Aug 2006, John Hunter wrote:
>> Hey Asheesh -- sorry we missed this the first time. I just
>> tried to apply it but the patch didn't go through because of
>> the dir naming conventions you are using on your system. Could
>> you try to get an svn co, apply your patch, and then submit an
>> 'svn diff' ?
Asheesh> That's attached. Also, try using "patch -p1" next
Asheesh> time. (-;
OK, it's in -- thanks!
JDH
|
|
From: Asheesh L. <as...@as...> - 2006-08-15 03:57:46
|
On Mon, 14 Aug 2006, John Hunter wrote: > Hey Asheesh -- sorry we missed this the first time. I just tried to > apply it but the patch didn't go through because of the dir naming > conventions you are using on your system. Could you try to get an svn > co, apply your patch, and then submit an 'svn diff' ? That's attached. Also, try using "patch -p1" next time. (-; I license this under the same terms at matplotlib is currently publicly distributed. -- Asheesh. -- Your boyfriend takes chocolate from strangers. |
|
From: John H. <jdh...@ac...> - 2006-08-15 03:00:13
|
>>>>> "Asheesh" == Asheesh Laroia <as...@as...> writes:
Asheesh> This patch does not change default behavior but provides
Asheesh> a useful feature enhancement that we use at Creative
Asheesh> Commons. It would be great if you, our humble upstream,
Asheesh> would accept it in the new point release. Would you?
Asheesh> Thanks! I'm subscribed to matplotlib-devel and welcome
Asheesh> comments. I've re-attached the patch in the case that it
Asheesh> got lost.
Hey Asheesh -- sorry we missed this the first time. I just tried to
apply it but the patch didn't go through because of the dir naming
conventions you are using on your system. Could you try to get an svn
co, apply your patch, and then submit an 'svn diff' ?
Thanks!
JDH
|
|
From: Darren D. <dd...@co...> - 2006-08-15 00:41:31
|
Hi Asheesh, It looks like your first email got overlooked. Sorry about that. Would you also post a bug report at the sourceforge webpage? I'll look at your patch when I get a chance. Darren On Monday 14 August 2006 8:17 pm, Asheesh Laroia wrote: > On Tue, 18 Jul 2006, Asheesh Laroia wrote: > > For pie charts, autopct lets a format string with the pie's value be > > printed on the chart. The default fraction of the radius that the text > > is printed at is 0.6; I wanted the text farther out at 0.85. > > > > This small patch (against matplotlib 0.87.4) allows one to customize that > > radius by a new keyword argument, pctradius. The old behavior is still > > the default. > > This patch does not change default behavior but provides a useful feature > enhancement that we use at Creative Commons. It would be great if you, > our humble upstream, would accept it in the new point release. Would you? > > Thanks! I'm subscribed to matplotlib-devel and welcome comments. I've > re-attached the patch in the case that it got lost. > > -- Asheesh. -- Darren S. Dale, Ph.D. dd...@co... |
|
From: Asheesh L. <as...@as...> - 2006-08-15 00:17:47
|
On Tue, 18 Jul 2006, Asheesh Laroia wrote: > For pie charts, autopct lets a format string with the pie's value be printed > on the chart. The default fraction of the radius that the text is printed at > is 0.6; I wanted the text farther out at 0.85. > > This small patch (against matplotlib 0.87.4) allows one to customize that > radius by a new keyword argument, pctradius. The old behavior is still the > default. This patch does not change default behavior but provides a useful feature enhancement that we use at Creative Commons. It would be great if you, our humble upstream, would accept it in the new point release. Would you? Thanks! I'm subscribed to matplotlib-devel and welcome comments. I've re-attached the patch in the case that it got lost. -- Asheesh. -- You are a bundle of energy, always on the go. |
|
From: John H. <jdh...@ac...> - 2006-08-14 22:00:30
|
>>>>> "Charlie" == Charlie Moad <cw...@gm...> writes:
Charlie> Numpy 1.0b2 was released last night and Travis hopes this
Charlie> will remain binary compatible with numpy 1.0. Are there
Charlie> any objections to a minor release bump? I could do this
Charlie> an soon as tomorrow.
Let's shoot for Tuesday evening, in advance of scipy. I'm going to
make one more attempt before then to get the damned widget lock
working right....
JDH
|
|
From: Charlie M. <cw...@gm...> - 2006-08-14 21:56:40
|
Numpy 1.0b2 was released last night and Travis hopes this will remain binary compatible with numpy 1.0. Are there any objections to a minor release bump? I could do this an soon as tomorrow. - Charlie |
|
From: Gregor T. <Gre...@st...> - 2006-08-13 18:19:01
|
Hi,
I am using matplotlib 87.4 and I encountered a problem with fill. The outlines
of the filled region look weird when using the TkAgg backend. Same applies when
saved to a png file, so this seems to be a problem of all *Agg backends. The PS
backend is fine. Here is a somewhat longer example, that shows this behaviour.
For comparison, drawing the same outlines with plot gives a perfectly smooth
result.
from pylab import *
clf()
x = linspace(0,1, 100)
y1 = x**2
y2 = 1.03*y1
xx = concatenate((x, x[::-1]))
yy = concatenate((y1, y2[::-1]))
fillh = fill(xx, yy, ec = 'k', lw = 0.4)
fillh = fillh[0]
fillh.set_fill(False)
ph = plot(x, y1+0.1, 'k-',
x, y2+0.1, 'k-', lw = 0.4)
savefig('jaggyfill.png', dpi = 150)
savefig('jaggyfill.eps')
show()
The more points I use, the worse the result. I create a png file since I need
alpha filling, eps doesn't support this. Creating a high resolution png and
downscaling improves the result, but this is tedious and time consuming. Any
help is appreciated!
Thanks in advance
Gregor Thalhammer
PS. Is this the right place to discuss such problems?
|
|
From: <mp...@ju...> - 2006-08-12 16:49:04
|
Hi folks, I recently required a multi-column legend for a matplotlib graph. I hacked up the Legend class to support this. I figured this might be useful to others, so I'm attaching a patch in the hopes that someone who is a regular contributor will review it and check it in. Disclaimer: I spent an hour learning python for the express purpose of making these graphs. That's the extent of my python experience so some things might have been done the long way around. It adds two parameters to the legend class: The first 'rowspercolumn' specifies how often to start a new column. If it is -1 then the current single-column behaviour is reproduced. I set this to -1 in my matplotlibrc file, and pass a specific number to the legend command when I want a multi-column legend. The second 'columnsep' specifies the distance between the right side of one column's label and the left side of the line of the next column. Columns are sized horizontally to fit the largest label in the column. I've tested it "extensively" on my case, with various combinations of columns and legend entries. It seems to be stable. But "extensively" is probably not a huge amount, honestly, and I'm new to matplotlib so I may not have covered all the cases. Cheers, Colin p.s. the patch is against the MacOS X binary distro which is at 0.87.4. |
|
From: John H. <jdh...@ac...> - 2006-08-11 20:03:54
|
>>>>> "Darren" == Darren Dale <dd...@co...> writes:
Darren> When I run the following: figure(); plot([1,2]) figure();
Darren> plot([1,2])
Darren> and then I use the zoom widget in one figure, and then try
Darren> to use the zoom widget in the other figure without turning
Darren> off the first zoom widget, I get an error. Is this
Darren> desirable?
No -- I hadn't considered this use case. The locking should be on a
per figure basis. I introduced locking to handle the case where
someone wants to use a widget that draws onto the canvas (like the
lasso tool) w/o interfering with the other tools that are handling
events. Eg, if pan/zoom is enabled and you are also trying to draw a
lasso, all hell breaks loose.
I've commented this out and will re-implement after further
consideration. Thanks for the heads-up.
JDH
|
|
From: Darren D. <dd...@co...> - 2006-08-11 19:47:20
|
When I run the following:
figure(); plot([1,2])
figure(); plot([1,2])
and then I use the zoom widget in one figure, and then try to use the zoom
widget in the other figure without turning off the first zoom widget, I get
an error. Is this desirable?
---------------------------------------------------------------------------
exceptions.ValueError Traceback (most recent
call last)
/usr/lib64/python2.4/site-packages/matplotlib/backends/backend_qt.py in
zoom(self, *args)
305 def zoom( self, *args ):
306 self.buttons[ 'Pan' ].setOn( False )
--> 307 NavigationToolbar2.zoom( self, *args )
308
309 def dynamic_update( self ):
/usr/lib64/python2.4/site-packages/matplotlib/backend_bases.py in zoom(self,
*args)
1564 self._idRelease =
self.canvas.mpl_connect('button_release_event', self.release_zoom)
1565 self.mode = 'Zoom to rect mode'
-> 1566 widgets.lock(self)
1567 else:
1568 #pass
/usr/lib64/python2.4/site-packages/matplotlib/widgets.py in __call__(self, o)
31 'reserve the lock for o'
32 if not self.available(o):
---> 33 raise ValueError('already locked')
34 self._owner = o
35
ValueError: already locked
Darren
|