SourceForge logo
SourceForge logo
Menu

matplotlib-devel — matplotlib developers

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
S M T W T F S


1
(1)
2
(9)
3
(1)
4
(3)
5
(1)
6
(2)
7
(9)
8
(2)
9
10
(10)
11
(4)
12
(1)
13
(1)
14
(2)
15
(9)
16
17
(1)
18
(6)
19
20
(4)
21
(7)
22
(3)
23
(3)
24
(2)
25
(1)
26
27
(3)
28
(6)
29
(12)
30
31
(8)


Showing 9 results of 9

From: <edi...@gm...> - 2006年08月15日 21:53:15
Attachments: mathtext.py
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 2006年8月14日, 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
Attachments: pat
On 2006年8月14日, 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 2006年7月18日, 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
Attachments: pie-pctradius.patch
On 2006年7月18日, 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.

Showing 9 results of 9

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.
Thanks for helping keep SourceForge clean.
X





Briefly describe the problem (required):
Upload screenshot of ad (required):
Select a file, or drag & drop file here.
Screenshot instructions:

Click URL instructions:
Right-click on the ad, choose "Copy Link", then paste here →
(This may not be possible with some types of ads)

More information about our ad policies

Ad destination/click URL:

AltStyle によって変換されたページ (->オリジナル) /