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





Showing results of 190

<< < 1 2 3 4 5 6 .. 8 > >> (Page 4 of 8)
From: Fernando P. <fpe...@gm...> - 2007年12月12日 00:37:43
On Dec 11, 2007 5:32 PM, Gael Varoquaux <gae...@no...> wrote:
> On Tue, Dec 11, 2007 at 07:14:11PM -0500, Darren Dale wrote:
> > RcParamsWrapper was created so we could get matplotlib working with the new
> > config object without a massive rewrite of the entire library. The intention
> > is to use the object-oriented interface internally, and to encourage users to
> > do the same. RcParamsWrapper simply provides the upgrade path.
>
> OK, Thanks a lot. I'll probably stick with pure objects, than, but I
> might modify the __repr__ of the object to make it more easily for the
> user to edit this interactively (ie making a representation more like to
> one you would get out of a dictionnary.
The tconfig objects already have a very dict-like representation for
dumping into a text file, the .ini format. Or do you mean something
that's even closer to a dict, curly braces and all?
> The problem is that it would break your script, so I can't send you a
> patch. I'd like the codebase to stay similar, so maybe we can discuss
> this once I have some code.
Yup, it would be good not to have mpl-tconfig, ipython-tconfig and
mayavi-tconfig :)
Cheers,
f
From: Gael V. <gae...@no...> - 2007年12月12日 00:33:31
On Tue, Dec 11, 2007 at 07:14:11PM -0500, Darren Dale wrote:
> RcParamsWrapper was created so we could get matplotlib working with the new 
> config object without a massive rewrite of the entire library. The intention 
> is to use the object-oriented interface internally, and to encourage users to 
> do the same. RcParamsWrapper simply provides the upgrade path.
OK, Thanks a lot. I'll probably stick with pure objects, than, but I
might modify the __repr__ of the object to make it more easily for the
user to edit this interactively (ie making a representation more like to
one you would get out of a dictionnary.
The problem is that it would break your script, so I can't send you a
patch. I'd like the codebase to stay similar, so maybe we can discuss
this once I have some code.
Gaël
From: Michael D. <md...@st...> - 2007年12月12日 00:16:44
Sorry. Try now.
(I use psvn.el for doing svn checkins, and I mostly think it's great, but it's awfully quiet when something fails.)
Cheers,
Mike
From: Darren D. <dar...@co...> - 2007年12月12日 00:14:24
On Tuesday 11 December 2007 7:03:57 pm Gael Varoquaux wrote:
> On Mon, Dec 10, 2007 at 08:23:57AM -0500, Darren Dale wrote:
> > Hi Gael,
> >
> > On Monday 10 December 2007 3:58:48 am Gael Varoquaux wrote:
> > > I am about to start a configuration file for mayavi's mlab, and I am
> > > strongly considering mimicking matplotlib's way of doing things.
> > >
> > > I am almost sold to Fernando's TConfig, but I am not too sure how this
> > > fits with the current rcParams dictionnary. Is there some code that I
> > > could study to see how it's done?
> >
> > Look in matplotlib/config/mplconfig.py, there is a class called
> > RcParamsWrapper that was designed to make the transition from rcParams to
> > TConfig easy for both developers and users. It should make the
> > relationship between the two pretty clear.
>
> OK, thanks.
>
> In the long run, what do you suggest I implement for mayavi2, an object
> oriented interface (pure TConfig) or an dictionnary-like interface
> (your RcParamsWrapper)?
>
> I am not too exited about your RcParamsWrapper because it is not
> generated from the configuration object, and thus the info is duplicated,
> but I guess you did this for backward compatibility reasons, and I could
> use a canonical mapping from one to the other and do this automatically.
>
> I would like to proivde an interface that feels familiar to the user,
> this is why I am looking closely at what MPL and ipython are doing.
RcParamsWrapper was created so we could get matplotlib working with the new 
config object without a massive rewrite of the entire library. The intention 
is to use the object-oriented interface internally, and to encourage users to 
do the same. RcParamsWrapper simply provides the upgrade path.
Darren
From: Gael V. <gae...@no...> - 2007年12月12日 00:04:25
On Mon, Dec 10, 2007 at 08:23:57AM -0500, Darren Dale wrote:
> Hi Gael,
> On Monday 10 December 2007 3:58:48 am Gael Varoquaux wrote:
> > I am about to start a configuration file for mayavi's mlab, and I am
> > strongly considering mimicking matplotlib's way of doing things.
> > I am almost sold to Fernando's TConfig, but I am not too sure how this
> > fits with the current rcParams dictionnary. Is there some code that I
> > could study to see how it's done?
> Look in matplotlib/config/mplconfig.py, there is a class called 
> RcParamsWrapper that was designed to make the transition from rcParams to 
> TConfig easy for both developers and users. It should make the relationship 
> between the two pretty clear.
OK, thanks.
In the long run, what do you suggest I implement for mayavi2, an object
oriented interface (pure TConfig) or an dictionnary-like interface
(your RcParamsWrapper)?
I am not too exited about your RcParamsWrapper because it is not
generated from the configuration object, and thus the info is duplicated,
but I guess you did this for backward compatibility reasons, and I could
use a canonical mapping from one to the other and do this automatically.
I would like to proivde an interface that feels familiar to the user,
this is why I am looking closely at what MPL and ipython are doing.
Cheers,
Gaël
From: John H. <jd...@gm...> - 2007年12月11日 21:38:58
On Dec 11, 2007 3:24 PM, Ted Drain <ted...@jp...> wrote:
> Thanks! That looks like a great solution. We'll take a look at it this
> week and try to beat on it w/ some more test cases.
Very nice work Michael -- I tried updating from your branch but it
looks like maybe you haven't committed yet, as the last log entry I am
seeing is:
 r4694 | mdboom | 2007年12月10日 13:53:12 -0600 (2007年12月10日) | 2 lines
 Simplify even more
JDH
From: Ted D. <ted...@jp...> - 2007年12月11日 21:25:00
Michael,
Thanks! That looks like a great solution. We'll take a look at it 
this week and try to beat on it w/ some more test cases.
Ted
At 12:46 PM 12/11/2007, Michael Droettboom wrote:
>Sorry -- correct attachment this time.
>
>Michael Droettboom wrote:
>>I have a working draft of something that may work for this problem 
>>on the transforms branch. I am happy to backport this to the 
>>trunk, but that will require some effort, as the implementation 
>>relies on many of the new geometric utilities on the branch that 
>>would also have to be brought over. It may be some time until the 
>>branch is ready for production use, but if you are able to use it 
>>to experiment with this approach to this specific problem, that 
>>would certainly make my life easier, so I don't have to do the 
>>backporting work more than once.
>>Attached is a plot comparing the new approach (above) vs. a 
>>750-edge polygonal approximation for the ellipses (based directly 
>>on James Evans' example). Here's a description of what it does:
>>
>> Ellipses are normally drawn using an approximation that uses
>> eight cubic bezier splines. The error of this approximation
>> is 1.89818e-6, according to this unverified source:
>> Lancaster, Don. Approximating a Circle or an Ellipse Using
>> Four Bezier Cubic Splines.
>> http://www.tinaja.com/glib/ellipse4.pdf
>> There is a use case where very large ellipses must be drawn
>> with very high accuracy, and it is too expensive to render the
>> entire ellipse with enough segments (either splines or line
>> segments). Therefore, in the case where either radius of the
>> ellipse is large enough that the error of the spline
>> approximation will be visible (greater than one pixel offset
>> from the ideal), a different technique is used.
>> In that case, only the visible parts of the ellipse are drawn,
>> with each visible arc using a fixed number of spline segments
>> (8). The algorithm proceeds as follows:
>> 1. The points where the ellipse intersects the axes bounding
>> box are located. (This is done be performing an inverse
>> transformation on the axes bbox such that it is relative to
>> the unit circle -- this makes the intersection calculation
>> much easier than doing rotated ellipse intersection
>> directly).
>> This uses the "line intersecting a circle" algorithm from:
>> Vince, John. Geometry for Computer Graphics: Formulae,
>> Examples & Proofs. London: Springer-Verlag, 2005.
>> 2. The angles of each of the intersection points are
>> calculated.
>> 3. Proceeding counterclockwise starting in the positive
>> x-direction, each of the visible arc-segments between the
>> pairs of vertices are drawn using the bezier arc
>> approximation technique implemented in Path.arc().
>>
>>Cheers,
>>Mike
>>
>>Ted Drain wrote:
>>>All of these sound like good ideas to me. Just for some history: 
>>>the original reason we worked w/ John to get an Ellipse primitive 
>>>in (vs a normal line plot of sampled points) were to:
>>>- improve ellipse plotting speeds (we plot a LOT of them at once)
>>>- improve post script output
>>>
>>>Ted
>>>
>>>At 08:53 AM 12/10/2007, Michael Droettboom wrote:
>>>>John Hunter wrote:
>>>>>On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
>>>>>
>>>>>>I don't know if the current MPL architecture can support this but it
>>>>>>would be nice if it worked that way. We have people making decisions
>>>>>>based on what these plots show that affect spacecraft worth hundreds
>>>>>>of millions of dollars so it's important that we're plotting
>>>>things accurately.
>>>>>We can support this, but I think we would do this with an arc class
>>>>>rather than an ellipse class, and write a special case class that is
>>>>>viewlim aware.
>>>>I agree -- I think there are two uses cases for ellipse that are in
>>>>conflict here. One is these large ellipses, the other is for things
>>>>like scatter plots, where speed and file size is more important than
>>>>accuracy. My mind was probably stuck on the latter as I've worked along
>>>>the transforms branch.
>>>>
>>>>>A simple example of a line that has analogous
>>>>>behavior is examples/clippedline.py, which clips the points outside
>>>>>the viewport and draws in a different style according to the
>>>>>resolution of the viewlim. The reason I think it would be preferable
>>>>>to use an arc here is because we won't have to worry about filling the
>>>>>thing when we only approximate a section of it. You could feed in a
>>>>>360 degree elliptical arc and then zoom into a portion of it.
>>>>>
>>>>>With the 8 point ellipse as is, and the addition of an arc class that
>>>>>does 4 or 8 point approximation within the zoom limits, should that
>>>>>serve your requirements?
>>>>As a possible starting point, the transforms branch already has
>>>>arc-approximation-by-cubic-bezier-spline code. It determines the number
>>>>of splines to use based on the radians included in the arc, which is
>>>>clearly not what we want here. But it should be reasonably
>>>>straightforward to make that some fixed number and draw the arc between
>>>>the edges of the axes. Or, alternatively, (and maybe this is what John
>>>>is suggesting), the arc could be approximated by line segments (with the
>>>>number of segments something like the number of pixels across the axes).
>>>> To my naive mind, that seems more verifiable -- or at least it puts
>>>>the responsibility of getting this right all in one place.
>>>>
>>>>IMHO, these spline approximation tricks are all just with the aim of
>>>>pushing curve rendering deeper into the backends for speed and file size
>>>>improvements. But obviously there needs to be a way around it when it
>>>>matters.
>>>>
>>>>Cheers,
>>>>Mike
>>>>
>>>>--
>>>>Michael Droettboom
>>>>Science Software Branch
>>>>Operations and Engineering Division
>>>>Space Telescope Science Institute
>>>>Operated by AURA for NASA
>>>>
>>>>-------------------------------------------------------------------------
>>>>SF.Net email is sponsored by:
>>>>Check out the new SourceForge.net Marketplace.
>>>>It's the best place to buy or sell services for
>>>>just about anything Open Source.
>>>>http://sourceforge.net/services/buy/index.php
>>>>_______________________________________________
>>>>Matplotlib-devel mailing list
>>>>Mat...@li...
>>>>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>
>>>Ted Drain Jet Propulsion Laboratory ted...@jp...
>>>
>>>
>>>-------------------------------------------------------------------------
>>>SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace.
>>>It's the best place to buy or sell services for
>>>just about anything Open Source.
>>>http://sourceforge.net/services/buy/index.php
>>>_______________________________________________
>>>Matplotlib-devel mailing list
>>>Mat...@li...
>>>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>>------------------------------------------------------------------------
>>
>>------------------------------------------------------------------------
>>-------------------------------------------------------------------------
>>SF.Net email is sponsored by: Check out the new SourceForge.net Marketplace.
>>It's the best place to buy or sell services for
>>just about anything Open Source.
>>http://sourceforge.net/services/buy/index.php
>>
>>------------------------------------------------------------------------
>>_______________________________________________
>>Matplotlib-devel mailing list
>>Mat...@li...
>>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
>
>
From: Michael D. <md...@st...> - 2007年12月11日 20:48:01
Attachments: ellipse.png
And an actually interesting part of the plot... ;)
Michael Droettboom wrote:
> Sorry -- correct attachment this time.
> 
> Michael Droettboom wrote:
>> I have a working draft of something that may work for this problem on 
>> the transforms branch. I am happy to backport this to the trunk, but 
>> that will require some effort, as the implementation relies on many of 
>> the new geometric utilities on the branch that would also have to be 
>> brought over. It may be some time until the branch is ready for 
>> production use, but if you are able to use it to experiment with this 
>> approach to this specific problem, that would certainly make my life 
>> easier, so I don't have to do the backporting work more than once.
>>
>> Attached is a plot comparing the new approach (above) vs. a 750-edge 
>> polygonal approximation for the ellipses (based directly on James 
>> Evans' example). Here's a description of what it does:
>>
>>
>> Ellipses are normally drawn using an approximation that uses
>> eight cubic bezier splines. The error of this approximation
>> is 1.89818e-6, according to this unverified source:
>>
>> Lancaster, Don. Approximating a Circle or an Ellipse Using
>> Four Bezier Cubic Splines.
>>
>> http://www.tinaja.com/glib/ellipse4.pdf
>>
>> There is a use case where very large ellipses must be drawn
>> with very high accuracy, and it is too expensive to render the
>> entire ellipse with enough segments (either splines or line
>> segments). Therefore, in the case where either radius of the
>> ellipse is large enough that the error of the spline
>> approximation will be visible (greater than one pixel offset
>> from the ideal), a different technique is used.
>>
>> In that case, only the visible parts of the ellipse are drawn,
>> with each visible arc using a fixed number of spline segments
>> (8). The algorithm proceeds as follows:
>>
>> 1. The points where the ellipse intersects the axes bounding
>> box are located. (This is done be performing an inverse
>> transformation on the axes bbox such that it is relative to
>> the unit circle -- this makes the intersection calculation
>> much easier than doing rotated ellipse intersection
>> directly).
>>
>> This uses the "line intersecting a circle" algorithm from:
>>
>> Vince, John. Geometry for Computer Graphics: Formulae,
>> Examples & Proofs. London: Springer-Verlag, 2005.
>>
>> 2. The angles of each of the intersection points are
>> calculated.
>>
>> 3. Proceeding counterclockwise starting in the positive
>> x-direction, each of the visible arc-segments between the
>> pairs of vertices are drawn using the bezier arc
>> approximation technique implemented in Path.arc().
>>
>>
>> Cheers,
>> Mike
>>
>>
>> Ted Drain wrote:
>>> All of these sound like good ideas to me. Just for some history: the 
>>> original reason we worked w/ John to get an Ellipse primitive in (vs 
>>> a normal line plot of sampled points) were to:
>>> - improve ellipse plotting speeds (we plot a LOT of them at once)
>>> - improve post script output
>>>
>>> Ted
>>>
>>> At 08:53 AM 12/10/2007, Michael Droettboom wrote:
>>>> John Hunter wrote:
>>>>> On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
>>>>>
>>>>>> I don't know if the current MPL architecture can support this but it
>>>>>> would be nice if it worked that way. We have people making decisions
>>>>>> based on what these plots show that affect spacecraft worth hundreds
>>>>>> of millions of dollars so it's important that we're plotting 
>>>> things accurately.
>>>>> We can support this, but I think we would do this with an arc class
>>>>> rather than an ellipse class, and write a special case class that is
>>>>> viewlim aware.
>>>> I agree -- I think there are two uses cases for ellipse that are in
>>>> conflict here. One is these large ellipses, the other is for things
>>>> like scatter plots, where speed and file size is more important than
>>>> accuracy. My mind was probably stuck on the latter as I've worked 
>>>> along
>>>> the transforms branch.
>>>>
>>>>> A simple example of a line that has analogous
>>>>> behavior is examples/clippedline.py, which clips the points outside
>>>>> the viewport and draws in a different style according to the
>>>>> resolution of the viewlim. The reason I think it would be preferable
>>>>> to use an arc here is because we won't have to worry about filling the
>>>>> thing when we only approximate a section of it. You could feed in a
>>>>> 360 degree elliptical arc and then zoom into a portion of it.
>>>>>
>>>>> With the 8 point ellipse as is, and the addition of an arc class that
>>>>> does 4 or 8 point approximation within the zoom limits, should that
>>>>> serve your requirements?
>>>> As a possible starting point, the transforms branch already has
>>>> arc-approximation-by-cubic-bezier-spline code. It determines the 
>>>> number
>>>> of splines to use based on the radians included in the arc, which is
>>>> clearly not what we want here. But it should be reasonably
>>>> straightforward to make that some fixed number and draw the arc between
>>>> the edges of the axes. Or, alternatively, (and maybe this is what John
>>>> is suggesting), the arc could be approximated by line segments (with 
>>>> the
>>>> number of segments something like the number of pixels across the 
>>>> axes).
>>>> To my naive mind, that seems more verifiable -- or at least it puts
>>>> the responsibility of getting this right all in one place.
>>>>
>>>> IMHO, these spline approximation tricks are all just with the aim of
>>>> pushing curve rendering deeper into the backends for speed and file 
>>>> size
>>>> improvements. But obviously there needs to be a way around it when it
>>>> matters.
>>>>
>>>> Cheers,
>>>> Mike
>>>>
>>>> -- 
>>>> Michael Droettboom
>>>> Science Software Branch
>>>> Operations and Engineering Division
>>>> Space Telescope Science Institute
>>>> Operated by AURA for NASA
>>>>
>>>> ------------------------------------------------------------------------- 
>>>>
>>>> SF.Net email is sponsored by:
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>> http://sourceforge.net/services/buy/index.php
>>>> _______________________________________________
>>>> Matplotlib-devel mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>
>>> Ted Drain Jet Propulsion Laboratory ted...@jp... 
>>>
>>> ------------------------------------------------------------------------- 
>>>
>>> SF.Net email is sponsored by: Check out the new SourceForge.net 
>>> Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> _______________________________________________
>>> Matplotlib-devel mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>>
>> ------------------------------------------------------------------------
>>
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by: Check out the new SourceForge.net 
>> Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>>
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> 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
From: Michael D. <md...@st...> - 2007年12月11日 20:46:29
Attachments: ellipse.png
Sorry -- correct attachment this time.
Michael Droettboom wrote:
> I have a working draft of something that may work for this problem on 
> the transforms branch. I am happy to backport this to the trunk, but 
> that will require some effort, as the implementation relies on many of 
> the new geometric utilities on the branch that would also have to be 
> brought over. It may be some time until the branch is ready for 
> production use, but if you are able to use it to experiment with this 
> approach to this specific problem, that would certainly make my life 
> easier, so I don't have to do the backporting work more than once.
> 
> Attached is a plot comparing the new approach (above) vs. a 750-edge 
> polygonal approximation for the ellipses (based directly on James Evans' 
> example). Here's a description of what it does:
> 
> 
> Ellipses are normally drawn using an approximation that uses
> eight cubic bezier splines. The error of this approximation
> is 1.89818e-6, according to this unverified source:
> 
> Lancaster, Don. Approximating a Circle or an Ellipse Using
> Four Bezier Cubic Splines.
> 
> http://www.tinaja.com/glib/ellipse4.pdf
> 
> There is a use case where very large ellipses must be drawn
> with very high accuracy, and it is too expensive to render the
> entire ellipse with enough segments (either splines or line
> segments). Therefore, in the case where either radius of the
> ellipse is large enough that the error of the spline
> approximation will be visible (greater than one pixel offset
> from the ideal), a different technique is used.
> 
> In that case, only the visible parts of the ellipse are drawn,
> with each visible arc using a fixed number of spline segments
> (8). The algorithm proceeds as follows:
> 
> 1. The points where the ellipse intersects the axes bounding
> box are located. (This is done be performing an inverse
> transformation on the axes bbox such that it is relative to
> the unit circle -- this makes the intersection calculation
> much easier than doing rotated ellipse intersection
> directly).
> 
> This uses the "line intersecting a circle" algorithm from:
> 
> Vince, John. Geometry for Computer Graphics: Formulae,
> Examples & Proofs. London: Springer-Verlag, 2005.
> 
> 2. The angles of each of the intersection points are
> calculated.
> 
> 3. Proceeding counterclockwise starting in the positive
> x-direction, each of the visible arc-segments between the
> pairs of vertices are drawn using the bezier arc
> approximation technique implemented in Path.arc().
> 
> 
> Cheers,
> Mike
> 
> 
> Ted Drain wrote:
>> All of these sound like good ideas to me. Just for some history: the 
>> original reason we worked w/ John to get an Ellipse primitive in (vs a 
>> normal line plot of sampled points) were to:
>> - improve ellipse plotting speeds (we plot a LOT of them at once)
>> - improve post script output
>>
>> Ted
>>
>> At 08:53 AM 12/10/2007, Michael Droettboom wrote:
>>> John Hunter wrote:
>>>> On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
>>>>
>>>>> I don't know if the current MPL architecture can support this but it
>>>>> would be nice if it worked that way. We have people making decisions
>>>>> based on what these plots show that affect spacecraft worth hundreds
>>>>> of millions of dollars so it's important that we're plotting 
>>> things accurately.
>>>> We can support this, but I think we would do this with an arc class
>>>> rather than an ellipse class, and write a special case class that is
>>>> viewlim aware.
>>> I agree -- I think there are two uses cases for ellipse that are in
>>> conflict here. One is these large ellipses, the other is for things
>>> like scatter plots, where speed and file size is more important than
>>> accuracy. My mind was probably stuck on the latter as I've worked along
>>> the transforms branch.
>>>
>>>> A simple example of a line that has analogous
>>>> behavior is examples/clippedline.py, which clips the points outside
>>>> the viewport and draws in a different style according to the
>>>> resolution of the viewlim. The reason I think it would be preferable
>>>> to use an arc here is because we won't have to worry about filling the
>>>> thing when we only approximate a section of it. You could feed in a
>>>> 360 degree elliptical arc and then zoom into a portion of it.
>>>>
>>>> With the 8 point ellipse as is, and the addition of an arc class that
>>>> does 4 or 8 point approximation within the zoom limits, should that
>>>> serve your requirements?
>>> As a possible starting point, the transforms branch already has
>>> arc-approximation-by-cubic-bezier-spline code. It determines the number
>>> of splines to use based on the radians included in the arc, which is
>>> clearly not what we want here. But it should be reasonably
>>> straightforward to make that some fixed number and draw the arc between
>>> the edges of the axes. Or, alternatively, (and maybe this is what John
>>> is suggesting), the arc could be approximated by line segments (with the
>>> number of segments something like the number of pixels across the axes).
>>> To my naive mind, that seems more verifiable -- or at least it puts
>>> the responsibility of getting this right all in one place.
>>>
>>> IMHO, these spline approximation tricks are all just with the aim of
>>> pushing curve rendering deeper into the backends for speed and file size
>>> improvements. But obviously there needs to be a way around it when it
>>> matters.
>>>
>>> Cheers,
>>> Mike
>>>
>>> -- 
>>> Michael Droettboom
>>> Science Software Branch
>>> Operations and Engineering Division
>>> Space Telescope Science Institute
>>> Operated by AURA for NASA
>>>
>>> ------------------------------------------------------------------------- 
>>>
>>> SF.Net email is sponsored by:
>>> Check out the new SourceForge.net Marketplace.
>>> It's the best place to buy or sell services for
>>> just about anything Open Source.
>>> http://sourceforge.net/services/buy/index.php
>>> _______________________________________________
>>> Matplotlib-devel mailing list
>>> Mat...@li...
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>> Ted Drain Jet Propulsion Laboratory ted...@jp... 
>>
>>
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by: Check out the new SourceForge.net 
>> Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
> 
> ------------------------------------------------------------------------
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> 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
From: Michael D. <md...@st...> - 2007年12月11日 20:43:44
Attachments: ellipse.png
I have a working draft of something that may work for this problem on 
the transforms branch. I am happy to backport this to the trunk, but 
that will require some effort, as the implementation relies on many of 
the new geometric utilities on the branch that would also have to be 
brought over. It may be some time until the branch is ready for 
production use, but if you are able to use it to experiment with this 
approach to this specific problem, that would certainly make my life 
easier, so I don't have to do the backporting work more than once.
Attached is a plot comparing the new approach (above) vs. a 750-edge 
polygonal approximation for the ellipses (based directly on James Evans' 
example). Here's a description of what it does:
 Ellipses are normally drawn using an approximation that uses
 eight cubic bezier splines. The error of this approximation
 is 1.89818e-6, according to this unverified source:
 Lancaster, Don. Approximating a Circle or an Ellipse Using
 Four Bezier Cubic Splines.
 http://www.tinaja.com/glib/ellipse4.pdf
 There is a use case where very large ellipses must be drawn
 with very high accuracy, and it is too expensive to render the
 entire ellipse with enough segments (either splines or line
 segments). Therefore, in the case where either radius of the
 ellipse is large enough that the error of the spline
 approximation will be visible (greater than one pixel offset
 from the ideal), a different technique is used.
 In that case, only the visible parts of the ellipse are drawn,
 with each visible arc using a fixed number of spline segments
 (8). The algorithm proceeds as follows:
 1. The points where the ellipse intersects the axes bounding
 box are located. (This is done be performing an inverse
 transformation on the axes bbox such that it is relative to
 the unit circle -- this makes the intersection calculation
 much easier than doing rotated ellipse intersection
 directly).
 This uses the "line intersecting a circle" algorithm from:
 Vince, John. Geometry for Computer Graphics: Formulae,
 Examples & Proofs. London: Springer-Verlag, 2005.
 2. The angles of each of the intersection points are
 calculated.
 3. Proceeding counterclockwise starting in the positive
 x-direction, each of the visible arc-segments between the
 pairs of vertices are drawn using the bezier arc
 approximation technique implemented in Path.arc().
Cheers,
Mike
Ted Drain wrote:
> All of these sound like good ideas to me. Just for some history: the 
> original reason we worked w/ John to get an Ellipse primitive in (vs 
> a normal line plot of sampled points) were to:
> - improve ellipse plotting speeds (we plot a LOT of them at once)
> - improve post script output
> 
> Ted
> 
> At 08:53 AM 12/10/2007, Michael Droettboom wrote:
>> John Hunter wrote:
>>> On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
>>>
>>>> I don't know if the current MPL architecture can support this but it
>>>> would be nice if it worked that way. We have people making decisions
>>>> based on what these plots show that affect spacecraft worth hundreds
>>>> of millions of dollars so it's important that we're plotting 
>> things accurately.
>>> We can support this, but I think we would do this with an arc class
>>> rather than an ellipse class, and write a special case class that is
>>> viewlim aware.
>> I agree -- I think there are two uses cases for ellipse that are in
>> conflict here. One is these large ellipses, the other is for things
>> like scatter plots, where speed and file size is more important than
>> accuracy. My mind was probably stuck on the latter as I've worked along
>> the transforms branch.
>>
>>> A simple example of a line that has analogous
>>> behavior is examples/clippedline.py, which clips the points outside
>>> the viewport and draws in a different style according to the
>>> resolution of the viewlim. The reason I think it would be preferable
>>> to use an arc here is because we won't have to worry about filling the
>>> thing when we only approximate a section of it. You could feed in a
>>> 360 degree elliptical arc and then zoom into a portion of it.
>>>
>>> With the 8 point ellipse as is, and the addition of an arc class that
>>> does 4 or 8 point approximation within the zoom limits, should that
>>> serve your requirements?
>> As a possible starting point, the transforms branch already has
>> arc-approximation-by-cubic-bezier-spline code. It determines the number
>> of splines to use based on the radians included in the arc, which is
>> clearly not what we want here. But it should be reasonably
>> straightforward to make that some fixed number and draw the arc between
>> the edges of the axes. Or, alternatively, (and maybe this is what John
>> is suggesting), the arc could be approximated by line segments (with the
>> number of segments something like the number of pixels across the axes).
>> To my naive mind, that seems more verifiable -- or at least it puts
>> the responsibility of getting this right all in one place.
>>
>> IMHO, these spline approximation tricks are all just with the aim of
>> pushing curve rendering deeper into the backends for speed and file size
>> improvements. But obviously there needs to be a way around it when it
>> matters.
>>
>> Cheers,
>> Mike
>>
>> --
>> Michael Droettboom
>> Science Software Branch
>> Operations and Engineering Division
>> Space Telescope Science Institute
>> Operated by AURA for NASA
>>
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by:
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> 
> Ted Drain Jet Propulsion Laboratory ted...@jp... 
> 
> 
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> 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
From: Paul K. <pki...@ni...> - 2007年12月11日 19:26:31
On Tue, Dec 11, 2007 at 10:22:12AM -0800, Christopher Barker wrote:
> Paul Kienzle wrote:
> > or if there are pending wx events. The scheme isn't perfect since wx
> > doesn't see all the native events, but it seems to work well enough.
> 
> I'm confused here -- what events are missed, and why? What do you mean 
> by a "native" event?
Intermediate mouse positions, for example, seem to be consumed. Also,
it doesn't seem to recognize pending resize events.
Try an experiment such as resizing examples/pcolor_log.py, with N large
enough to make redraws slow to see what I mean (N=200 does it for me).
I tried changing the _onSize event handler to use draw_idle rather 
than draw to improve the resize experience but I shut it off because 
the drawing area turns black and I couldn't figure out how to set it 
to the figure background colour. It helped slow graphs a little since 
I could see what the resulting window would look like, but the black 
was jarring for quick graphs.
Any thoughts on implementing preemptive plotting? 
This would mean putting tests like the following inside potentially 
expensive loops:
 if self.isabort(): break
where isabort is a method in class artist which delegates to the canvas:
 return self.figure.canvas.isabort() if self.figure else False
For the wx canvas, isabort() would be something like:
 wx.Yield() # Allow UI events to be processed
 return self._draw_idle_requested # abort drawing if UI triggered redraw
> > 2) Don't draw bitmap on the screen if the graph isn't shown. Otherwise
> > a plot inside of a wx aui notebook bleeds through even if the graph
> > notebook is not on top.
> 
> hmmm odd -- this does sound right, but shouldn't wx only be re-drawing 
> in a Paint event anyway?
I haven't traced through the wx.aui code so I don't know what is going
on. I do know that I have problems if I don't check IsWindowShown 
before blitting the bitmap onto the screen.
> > 3) Don't regenerate entire plot for each PaintEvent. Instead, only
> > draw the graph if this is the first time the window is exposed, otherwise
> > work from the bitmap.
> 
> This is odd to me too -- I haven't dug into the wx back-end, but it 
> seems the Paint Event should only trigger a blit of the bitmap to the 
> screen anyway.
It should, but the bitmap may not be initialized when the paint event
occurs. This happens when the window is first created (since there is 
no associated size event) and now when switching aui notebook windows
(since I don't render the bitmap if the window isn't shown).
	- Paul
From: Christopher B. <Chr...@no...> - 2007年12月11日 18:20:36
Paul Kienzle wrote:
> 1) implement draw_idle. Rather than using the wx IdleEvent which seemed
> to be triggered too often 
good idea -- the wx Idle event is triggered A LOT. I've never found a 
use for it.
> I used a timer which is delayed and possibly
> reset if a new draw request comes within a certain time period (5 ms),
That's a common trick, and has always worked well for me.
> or if there are pending wx events. The scheme isn't perfect since wx
> doesn't see all the native events, but it seems to work well enough.
I'm confused here -- what events are missed, and why? What do you mean 
by a "native" event?
> 2) Don't draw bitmap on the screen if the graph isn't shown. Otherwise
> a plot inside of a wx aui notebook bleeds through even if the graph
> notebook is not on top.
hmmm odd -- this does sound right, but shouldn't wx only be re-drawing 
in a Paint event anyway?
> 3) Don't regenerate entire plot for each PaintEvent. Instead, only
> draw the graph if this is the first time the window is exposed, otherwise
> work from the bitmap.
This is odd to me too -- I haven't dug into the wx back-end, but it 
seems the Paint Event should only trigger a blit of the bitmap to the 
screen anyway.
 > I've only tested this for wxagg on the mac. I don't
> know if it breaks wx, or if anyone cares about wx anymore.
You mean wx, rather then wxAgg? I now some folks have found it useful 
for remote X sessions -- but I don't know how important it is to support 
that.
-Chris
-- 
Christopher Barker, Ph.D.
Oceanographer
Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception
Chr...@no...
From: Michael D. <md...@st...> - 2007年12月11日 17:59:46
Thanks. This has already been fixed in SVN, and should make it into the 
0.91.2 release shortly.
Cheers,
Mike
Brandon Reno wrote:
> I get this error when using canvas.print_svg():
> 
> In [27]: canvas.print_svg(buffer)
> ---------------------------------------------------------------------------
> <type 'exceptions.NameError'> Traceback (most recent call last)
> 
> Z:\<ipython console> in <module>()
> 
> C:\Python25\Lib\site-packages\matplotlib\backend_bases.py in 
> print_svg(self, *ar
> gs, **kwargs)
> 1124 from backends.backend_svg import FigureCanvasSVG # lazy 
> import
> 1125 svg = self.switch_backends(FigureCanvasSVG)
> -> 1126 return svg.print_svg(*args, **kwargs)
> 1127
> 1128 def print_svgz(self, *args, **kwargs):
> 
> C:\Python25\Lib\site-packages\matplotlib\backends\backend_svg.py in 
> print_svg(se
> lf, filename, *args, **kwargs)
> 463 if is_string_like(filename):
> 464 fh_to_close = svgwriter = codecs.open(filename, 'w', 
> 'utf-8'
> )
> --> 465 elif is_writable_file_like(filename):
> 466 svgwriter = codecs.EncodedFile(filename, 'utf-8')
> 467 fh_to_close = None
> 
> C:\Python25\Lib\site-packages\matplotlib\cbook.py in 
> is_writable_file_like(obj)
> 215
> 216 def is_writable_file_like(obj):
> --> 217 return hasattr(filename, 'write') and callable(filename.write)
> 218
> 219 def is_scalar(obj):
> 
> <type 'exceptions.NameError'>: global name 'filename' is not defined
> 
> In [28]: canvas
> Out[28]: <matplotlib.backends.backend_tkagg.FigureCanvasTkAgg instance 
> at 0x01CA
> EDF0>
> 
> It seems that
> def is_writable_file_like(obj):
> 
> should be
> def is_writable_file_like(filename):
> 
> 
> ------------------------------------------------------------------------
> 
> -------------------------------------------------------------------------
> SF.Net email is sponsored by: 
> Check out the new SourceForge.net Marketplace.
> It's the best place to buy or sell services for
> just about anything Open Source.
> http://sourceforge.net/services/buy/index.php
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Matplotlib-devel mailing list
> Mat...@li...
> 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
From: Paul K. <pki...@ni...> - 2007年12月11日 17:42:43
Attachments: wx.patch
Hi,
The attached patch has a couple of changes to the wx backend that I
want people to test before I commit.
1) implement draw_idle. Rather than using the wx IdleEvent which seemed
to be triggered too often I used a timer which is delayed and possibly
reset if a new draw request comes within a certain time period (5 ms),
or if there are pending wx events. The scheme isn't perfect since wx
doesn't see all the native events, but it seems to work well enough.
2) Don't draw bitmap on the screen if the graph isn't shown. Otherwise
a plot inside of a wx aui notebook bleeds through even if the graph
notebook is not on top.
3) Don't regenerate entire plot for each PaintEvent. Instead, only
draw the graph if this is the first time the window is exposed, otherwise
work from the bitmap. I've only tested this for wxagg on the mac. I don't
know if it breaks wx, or if anyone cares about wx anymore.
Let me know if it works for you.
	- Paul
From: Brandon R. <bra...@gm...> - 2007年12月11日 16:13:00
I get this error when using canvas.print_svg():
In [27]: canvas.print_svg(buffer)
---------------------------------------------------------------------------
<type 'exceptions.NameError'> Traceback (most recent call last)
Z:\<ipython console> in <module>()
C:\Python25\Lib\site-packages\matplotlib\backend_bases.py in print_svg(self,
*ar
gs, **kwargs)
 1124 from backends.backend_svg import FigureCanvasSVG # lazy
import
 1125 svg = self.switch_backends(FigureCanvasSVG)
-> 1126 return svg.print_svg(*args, **kwargs)
 1127
 1128 def print_svgz(self, *args, **kwargs):
C:\Python25\Lib\site-packages\matplotlib\backends\backend_svg.py in
print_svg(se
lf, filename, *args, **kwargs)
 463 if is_string_like(filename):
 464 fh_to_close = svgwriter = codecs.open(filename, 'w',
'utf-8'
)
--> 465 elif is_writable_file_like(filename):
 466 svgwriter = codecs.EncodedFile(filename, 'utf-8')
 467 fh_to_close = None
C:\Python25\Lib\site-packages\matplotlib\cbook.py in
is_writable_file_like(obj)
 215
 216 def is_writable_file_like(obj):
--> 217 return hasattr(filename, 'write') and callable(filename.write)
 218
 219 def is_scalar(obj):
<type 'exceptions.NameError'>: global name 'filename' is not defined
In [28]: canvas
Out[28]: <matplotlib.backends.backend_tkagg.FigureCanvasTkAgg instance at
0x01CA
EDF0>
It seems that
def is_writable_file_like(obj):
should be
def is_writable_file_like(filename):
From: william r. <wil...@gm...> - 2007年12月10日 22:09:38
I am again trying to build matplotlib from source on svn--What versions of
freetype, libpng, zlib, etc. are used for the current build (I'm using
mingw)?
Also, can someone update the win32_static folder to reflect the current
versions? Thanks!!!!
William
From: Ted D. <ted...@jp...> - 2007年12月10日 17:35:00
All of these sound like good ideas to me. Just for some history: the 
original reason we worked w/ John to get an Ellipse primitive in (vs 
a normal line plot of sampled points) were to:
- improve ellipse plotting speeds (we plot a LOT of them at once)
- improve post script output
Ted
At 08:53 AM 12/10/2007, Michael Droettboom wrote:
>John Hunter wrote:
> > On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
> >
> >> I don't know if the current MPL architecture can support this but it
> >> would be nice if it worked that way. We have people making decisions
> >> based on what these plots show that affect spacecraft worth hundreds
> >> of millions of dollars so it's important that we're plotting 
> things accurately.
> >
> > We can support this, but I think we would do this with an arc class
> > rather than an ellipse class, and write a special case class that is
> > viewlim aware.
>
>I agree -- I think there are two uses cases for ellipse that are in
>conflict here. One is these large ellipses, the other is for things
>like scatter plots, where speed and file size is more important than
>accuracy. My mind was probably stuck on the latter as I've worked along
>the transforms branch.
>
> > A simple example of a line that has analogous
> > behavior is examples/clippedline.py, which clips the points outside
> > the viewport and draws in a different style according to the
> > resolution of the viewlim. The reason I think it would be preferable
> > to use an arc here is because we won't have to worry about filling the
> > thing when we only approximate a section of it. You could feed in a
> > 360 degree elliptical arc and then zoom into a portion of it.
> >
> > With the 8 point ellipse as is, and the addition of an arc class that
> > does 4 or 8 point approximation within the zoom limits, should that
> > serve your requirements?
>
>As a possible starting point, the transforms branch already has
>arc-approximation-by-cubic-bezier-spline code. It determines the number
>of splines to use based on the radians included in the arc, which is
>clearly not what we want here. But it should be reasonably
>straightforward to make that some fixed number and draw the arc between
>the edges of the axes. Or, alternatively, (and maybe this is what John
>is suggesting), the arc could be approximated by line segments (with the
>number of segments something like the number of pixels across the axes).
> To my naive mind, that seems more verifiable -- or at least it puts
>the responsibility of getting this right all in one place.
>
>IMHO, these spline approximation tricks are all just with the aim of
>pushing curve rendering deeper into the backends for speed and file size
>improvements. But obviously there needs to be a way around it when it
>matters.
>
>Cheers,
>Mike
>
>--
>Michael Droettboom
>Science Software Branch
>Operations and Engineering Division
>Space Telescope Science Institute
>Operated by AURA for NASA
>
>-------------------------------------------------------------------------
>SF.Net email is sponsored by:
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>_______________________________________________
>Matplotlib-devel mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: Michael D. <md...@st...> - 2007年12月10日 16:53:58
John Hunter wrote:
> On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
> 
>> I don't know if the current MPL architecture can support this but it
>> would be nice if it worked that way. We have people making decisions
>> based on what these plots show that affect spacecraft worth hundreds
>> of millions of dollars so it's important that we're plotting things accurately.
> 
> We can support this, but I think we would do this with an arc class
> rather than an ellipse class, and write a special case class that is
> viewlim aware.
I agree -- I think there are two uses cases for ellipse that are in 
conflict here. One is these large ellipses, the other is for things 
like scatter plots, where speed and file size is more important than 
accuracy. My mind was probably stuck on the latter as I've worked along 
the transforms branch.
> A simple example of a line that has analogous
> behavior is examples/clippedline.py, which clips the points outside
> the viewport and draws in a different style according to the
> resolution of the viewlim. The reason I think it would be preferable
> to use an arc here is because we won't have to worry about filling the
> thing when we only approximate a section of it. You could feed in a
> 360 degree elliptical arc and then zoom into a portion of it.
> 
> With the 8 point ellipse as is, and the addition of an arc class that
> does 4 or 8 point approximation within the zoom limits, should that
> serve your requirements?
As a possible starting point, the transforms branch already has 
arc-approximation-by-cubic-bezier-spline code. It determines the number 
of splines to use based on the radians included in the arc, which is 
clearly not what we want here. But it should be reasonably 
straightforward to make that some fixed number and draw the arc between 
the edges of the axes. Or, alternatively, (and maybe this is what John 
is suggesting), the arc could be approximated by line segments (with the 
number of segments something like the number of pixels across the axes). 
 To my naive mind, that seems more verifiable -- or at least it puts 
the responsibility of getting this right all in one place.
IMHO, these spline approximation tricks are all just with the aim of 
pushing curve rendering deeper into the backends for speed and file size 
improvements. But obviously there needs to be a way around it when it 
matters.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2007年12月10日 16:36:02
On Dec 10, 2007 10:25 AM, Ted Drain <ted...@jp...> wrote:
> I don't know if the current MPL architecture can support this but it
> would be nice if it worked that way. We have people making decisions
> based on what these plots show that affect spacecraft worth hundreds
> of millions of dollars so it's important that we're plotting things accurately.
We can support this, but I think we would do this with an arc class
rather than an ellipse class, and write a special case class that is
viewlim aware. A simple example of a line that has analogous
behavior is examples/clippedline.py, which clips the points outside
the viewport and draws in a different style according to the
resolution of the viewlim. The reason I think it would be preferable
to use an arc here is because we won't have to worry about filling the
thing when we only approximate a section of it. You could feed in a
360 degree elliptical arc and then zoom into a portion of it.
With the 8 point ellipse as is, and the addition of an arc class that
does 4 or 8 point approximation within the zoom limits, should that
serve your requirements?
JDH
From: Ted D. <ted...@jp...> - 2007年12月10日 16:25:31
Everyone,
Before someone spends a lot of time re-working the ellipse code to 
add more splines, I think we should talk about the problem and maybe 
consider another approach.
The real problem w/ this for us is that we plot a lot of things at 
interplanetary scales (millions of kilometers). Even 1e-6 accuracy 
is still a miss of a kilometer (assuming that error tolerance is 
related to r).
What we really need is something that is viewport (i.e. the data 
range being currently viewed) dependent. The errors for the 4 spline 
case are fine as long as it's a spline through 4 points that are in 
the viewport window. So if I have an ellipse that's 3 million by 5 
million and I'm viewing the whole thing on a plot, 1e-4 of 3e6 is 
fine. However, if I've zoomed in to a portion of the ellipse and my 
current axes bounds are 10 km x 10 km, then 1e-4 isn't fine AND 1e-6 
isn't fine either. If we could recompute the curve based on the 
current zoom level, then 1e-4 is fine again.
One way to think about this is as error in pixels (since that's what 
the user is actually looking at). It would be nice if the pixel 
error could be held constant. Let's say that one pixel is the error 
we're going for. Any system that gives a one pixel error at 
arbitrary zoom levels is the way to go. A system with an error 
expressed in data coordinates will always have problems at some 
arbitrary zoom level.
I don't know if the current MPL architecture can support this but it 
would be nice if it worked that way. We have people making decisions 
based on what these plots show that affect spacecraft worth hundreds 
of millions of dollars so it's important that we're plotting things accurately.
Ted
At 07:26 AM 12/10/2007, Michael Droettboom wrote:
>John Hunter wrote:
> > On Dec 10, 2007 8:51 AM, Michael Droettboom <md...@st...> wrote:
> >
> >> I have 8-spline approximation working on the trunk and on the transforms
> >> branch. (r4679)
> >
> > Thanks Michael, I was working on this myself but it is hard for me to
> > keep up with you :-)
>
>No problem. I wasn't sure if you were still on vacation... Feel free
>to replace mine with whatever you came up with if you see further benefit.
>
> > In reading the paper Charlie sent and links therein
> > (<http://www.tinaja.com/glib/ellipse4.pdf 
> and>http://www.tinaja.com/glib/ellipse4.pdf and
> > http://itc.ktu.lt/itc354/Riskus354.pdf), one comment was that the
> > usual magic number
> >
> > offset = 4.0 * (npy.sqrt(2) - 1) / 3.0
> >
> > is not ideal. When I tested the JPLs test script with one of the
> > suggested magic numbers which minimize the SS errors with 4 points on
> > the ellipse, the error was smaller than what we were getting with the
> > one above (I used k=0.55191496 from the Rivus paper).
>
>The first thing I tried when I saw Lancaster's paper (from Charlie's
>e-mail) was to leave it as four splines and use his suggested number of
>0.551784. That improved things for James' example, but not nearly
>enough. There were still around 10 pixels between where the ellipses
>should be and where they were. It's possible that an even better magic
>number exists (I gather Lancaster's was arrived at by experimentation),
>but I was doubtful that one could be found that would be as good as just
>going to 8 splines.
>
> > I see you are
> > using a different formula for the magic number in the trunk. Do you
> > think we could see additional accuracy with a different magic number
> > as discussed in these papers?
>
>For the 8 spline approximation I put in the trunk this morning, I used
>Lancaster's suggested magic number of 0.2652031. (MAGIC45 is just the
>rectilinear distance of the MAGIC number at a 45 degree angle). Again,
>feel free to tinker, but that number seemed "good enough" on James' example.
>
>Cheers,
>Mike
>
>--
>Michael Droettboom
>Science Software Branch
>Operations and Engineering Division
>Space Telescope Science Institute
>Operated by AURA for NASA
>
>-------------------------------------------------------------------------
>SF.Net email is sponsored by:
>Check out the new SourceForge.net Marketplace.
>It's the best place to buy or sell services for
>just about anything Open Source.
>http://sourceforge.net/services/buy/index.php
>_______________________________________________
>Matplotlib-devel mailing list
>Mat...@li...
>https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
Ted Drain Jet Propulsion Laboratory ted...@jp... 
From: Michael D. <md...@st...> - 2007年12月10日 16:00:49
John Hunter wrote:
> The finally clauses in font_manager.py are python2.5 only and should
> be removed. Michael, I suspect you added these when cleaning up the
> open file handle bugs, but we'll have to find another solution.
I added this cleaning up a fairly narrow Vista-only bug at the 
suggestion of Richard Bolt, and without being on Vista myself ;) (r4653).
http://sourceforge.net/tracker/index.php?func=detail&aid=1841933&group_id=80706&atid=560720
This change was made post-0.91.1, so I don't believe it made it into a 
release. I've changed it to nested "try"s as suggested in the Python 
reference docs.
> Shouldn't these be picked up by the garbage collector?
Possibly, but the "finally" was there before I got there -- I assumed 
there was a need for it, and I didn't have Windows handy to test with.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: Michael D. <md...@st...> - 2007年12月10日 15:26:46
John Hunter wrote:
> On Dec 10, 2007 8:51 AM, Michael Droettboom <md...@st...> wrote:
> 
>> I have 8-spline approximation working on the trunk and on the transforms
>> branch. (r4679)
> 
> Thanks Michael, I was working on this myself but it is hard for me to
> keep up with you :-)
No problem. I wasn't sure if you were still on vacation... Feel free 
to replace mine with whatever you came up with if you see further benefit.
> In reading the paper Charlie sent and links therein
> (http://www.tinaja.com/glib/ellipse4.pdf and
> http://itc.ktu.lt/itc354/Riskus354.pdf), one comment was that the
> usual magic number
> 
> offset = 4.0 * (npy.sqrt(2) - 1) / 3.0
> 
> is not ideal. When I tested the JPLs test script with one of the
> suggested magic numbers which minimize the SS errors with 4 points on
> the ellipse, the error was smaller than what we were getting with the
> one above (I used k=0.55191496 from the Rivus paper).
The first thing I tried when I saw Lancaster's paper (from Charlie's 
e-mail) was to leave it as four splines and use his suggested number of 
0.551784. That improved things for James' example, but not nearly 
enough. There were still around 10 pixels between where the ellipses 
should be and where they were. It's possible that an even better magic 
number exists (I gather Lancaster's was arrived at by experimentation), 
but I was doubtful that one could be found that would be as good as just 
going to 8 splines.
> I see you are
> using a different formula for the magic number in the trunk. Do you
> think we could see additional accuracy with a different magic number
> as discussed in these papers?
For the 8 spline approximation I put in the trunk this morning, I used 
Lancaster's suggested magic number of 0.2652031. (MAGIC45 is just the 
rectilinear distance of the MAGIC number at a 45 degree angle). Again, 
feel free to tinker, but that number seemed "good enough" on James' example.
Cheers,
Mike
-- 
Michael Droettboom
Science Software Branch
Operations and Engineering Division
Space Telescope Science Institute
Operated by AURA for NASA
From: John H. <jd...@gm...> - 2007年12月10日 15:19:07
The finally clauses in font_manager.py are python2.5 only and should
be removed. Michael, I suspect you added these when cleaning up the
open file handle bugs, but we'll have to find another solution.
Shouldn't these be picked up by the garbage collector?
JDH
From: John H. <jd...@gm...> - 2007年12月10日 15:12:31
On Dec 10, 2007 8:51 AM, Michael Droettboom <md...@st...> wrote:
> I have 8-spline approximation working on the trunk and on the transforms
> branch. (r4679)
Thanks Michael, I was working on this myself but it is hard for me to
keep up with you :-)
In reading the paper Charlie sent and links therein
(http://www.tinaja.com/glib/ellipse4.pdf and
http://itc.ktu.lt/itc354/Riskus354.pdf), one comment was that the
usual magic number
offset = 4.0 * (npy.sqrt(2) - 1) / 3.0
is not ideal. When I tested the JPLs test script with one of the
suggested magic numbers which minimize the SS errors with 4 points on
the ellipse, the error was smaller than what we were getting with the
one above (I used k=0.55191496 from the Rivus paper). I see you are
using a different formula for the magic number in the trunk. Do you
think we could see additional accuracy with a different magic number
as discussed in these papers?
JDH
From: Michael D. <md...@st...> - 2007年12月10日 14:51:45
Michael Droettboom wrote:
> Charlie Moad wrote:
>> I did some more digging and it looks like this changed with the
>> transforms. curve4 is now being called instead of arc_to, which uses
>> beziers.
> 
> curve4 is the way to specify a cubic bezier curve, so it is functionally 
> equivalent to the old arc_to approach (but easier to be consistent 
> across backends, which is why the change was made).
Sorry, I was confused... John recently fixed the ellipse drawing on the 
trunk (which was broken wrt rotated ellipses), to use bezier curves 
instead of agg's arc_to. Agg's arc_to itself isn't broken wrt to James' 
problem -- in fact it does provide sufficient accuracy -- it was the way 
mpl used arc_to in previous incarnations that was broken wrt rotated 
ellipses. Unfortunately, the fix for that reduced accuracy to noticable 
levels on these really large ellipses. So, in order to have the best of 
both worlds, I agree the 8-spline approximation seems like the way to go.
(But the changes on the transforms branch are irrelevant here -- they do 
essentially the same thing the trunk currently does: that is 4 spline 
approximation of the circle).
> I'm attempting to implement the 8-spline approximation and I'll let you 
> know how that goes.
I have 8-spline approximation working on the trunk and on the transforms 
branch. (r4679)
In the process, I uncovered another bug (which I suppose should have 
been obvious when ellipses were updated last time, but went right by me) 
-- ellipses don't work at all in the pdf, svg or cairo backends, since 
they don't implement draw_path. I'll file a placeholder bug for this, 
and hopefully get to it, time permitting.
> In any case, I think we should add James' example 
> to our unit tests, since it illustrates a case where my assumptions 
> about how ellipses would be used breaks down.
Also done.
Cheers,
Mike
>> On Dec 9, 2007 10:11 AM, Charlie Moad <cw...@gm...> wrote:
>>> I found a great doc I am linking. The 4 spline method we are using
>>> has an error tolerance of 2.7*10^-4, which I am pretty sure is coming
>>> into play here. If we move to an 8 spline approach, it would reduce
>>> the error a few orders of magnitude.
>>>
>>> http://www.tinaja.com/glib/ellipse4.pdf
>>>
>>> - Charlie
>>>
>>>
>>>
>>> On Dec 8, 2007 9:09 AM, John Hunter <jd...@gm...> wrote:
>>>> On Dec 7, 2007 6:02 PM, James Evans <jre...@ea...> wrote:
>>>>
>>>>> There appears to be an issue with the agg backend with how it is drawing
>>>>> ellipses (or maybe it is how matplotlib uses agg), but the attached script
>>>>> shows how a point, which should be coincident with the center circle, but it
>>>>> is not. The second plot shows the same data, but using a custom (and much
>>>>> slower) algorithm for drawing the ellipses, where the point is properly
>>>>> coincident.
>>>> Thanks for the test case James -- I will try and sort this out ASAP.
>>>> Michael, do you see the same on the transforms branch? The branch is
>>>> on a newer version of agg so if not, perhaps it is a simple matter of
>>>> upgrading agg on the trunk. I'm travelling currently bt will be back
>>>> omorrow and ill look at this ASAP.
>>>>
>>>> JDH
>>>>
>>>> -------------------------------------------------------------------------
>>>> SF.Net email is sponsored by:
>>>> Check out the new SourceForge.net Marketplace.
>>>> It's the best place to buy or sell services for
>>>> just about anything Open Source.
>>>> http://sourceforge.net/services/buy/index.php
>>>> _______________________________________________
>>>> Matplotlib-devel mailing list
>>>> Mat...@li...
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>>
>> -------------------------------------------------------------------------
>> SF.Net email is sponsored by: 
>> Check out the new SourceForge.net Marketplace.
>> It's the best place to buy or sell services for
>> just about anything Open Source.
>> http://sourceforge.net/services/buy/index.php
>> _______________________________________________
>> Matplotlib-devel mailing list
>> Mat...@li...
>> 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

Showing results of 190

<< < 1 2 3 4 5 6 .. 8 > >> (Page 4 of 8)
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 によって変換されたページ (->オリジナル) /