Re: [matplotlib-devel] Patch/fix for two legend oddities/bugs

2010-06-09 Thread Jae-Joon Lee
Thanks for reporting these.
I took a look at your patch and slight revised it (see the attached).
While I believe that my patch is compatible to yours, it'll be great
if you check my patch to see if I missed anything.
I'll commit the change soon.

Regards,

-JJ


On Tue, Jun 8, 2010 at 3:16 PM, Erik Tollerud  wrote:
> I noticed some odd behavior in the legend and managed to track down
> the source of the problem and make a fix (a diff against the current
> svn is attached). Specifically, two things were fixed:
>
> *The "markerscale" argument for the legend seems to do nothing...  The
> attached diff properly applies the markerscale scaling for
> polygon/circle collections and the markers for lines with markers (but
> NOT patches or the width of lines elements in the legend).
>
> *If the "scatterpoints" argument was >3, all points beyond 3
> disappeared.  This was because the default scatteryoffset only had 3
> entries, so if you didn't specifically overwrite this, the points
> beyond 3 didn't appear.  I've re-worked this so that now the default
> properly deals with a number of points other than 3.
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>


scatterfix_jjlee.diff
Description: Binary data
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Is there a way to link axes of imshow plots?

2010-06-09 Thread Benjamin Root
Has anybody given any further thought to the implication of having Basemap
set adjustable as "box-forced" instead of "box"?  So far, it has been
working just fine for me, but I have no clue if there are any unintended
side-effects.

Ben Root


On Tue, Jun 1, 2010 at 6:00 PM, Benjamin Root  wrote:

> Right, that is sort of what I am asking.  My thinking is that Basemap could
> use 'box-forced' instead of 'box' for the adjustable parameter in order to
> make it and AxesGrid compatible.  Usually, if one wants to use AxesGrid,
> they all should have the same domain and aspect ratio.  I just have no clue
> what sort of repricussions that has for other use cases.
>
> So far, this has worked just fine for me, but I hardly represent the normal
> use cases of Basemap and AxesGrid.
>
> Ben Root
>
>
> On Tue, Jun 1, 2010 at 5:20 PM, Jae-Joon Lee  wrote:
>
>> If Basemap explicitly sets aspect=1 and adjustable="box" at the same
>> time, you cannot use this with any axes that shares its axis with
>> others (including the axes created by the AxesGrid).
>>
>> You need to somehow avoid the set_aspect call with adjustable"box"
>> (you can set box-forced in stead).
>>
>> -JJ
>>
>>
>> On Tue, Jun 1, 2010 at 2:45 PM, Benjamin Root  wrote:
>> >
>> > On a related note, I have noticed an incompatibility between AxesGrid
>> and
>> > Basemap.  It appears that Basemap will explicitly set adjustable='box'
>> when
>> > it calls ax.set_aspect(), but AxesGrid will error out, saying that it
>> has to
>> > be 'datalim'.  What are the implications of using 'box-forced' instead
>> of
>> > 'box' in Basemap?
>> >
>> > Ben Root
>> >
>> > On Thu, May 27, 2010 at 1:59 PM, Jae-Joon Lee 
>> wrote:
>> >>
>> >> ax1 = subplot(121)
>> >> ax2 = subplot(122, sharex=ax1, sharey=ax1)
>> >>
>> >> ax1.set_adjustable("box-forced")
>> >> ax2.set_adjustable("box-forced")
>> >>
>> >> arr1 = np.arange(100).reshape((10, 10))
>> >> ax1.imshow(arr1)
>> >>
>> >> arr2 = np.arange(100, 0, -1).reshape((10, 10))
>> >> ax2.imshow(arr2)
>> >>
>> >> Note the use of set_adjustable("box-forced").
>> >> sharex and sharey does not get along with axes of aspect=1 &
>> >> adjustable="box".
>> >>
>> >> -JJ
>> >>
>> >>
>> >>
>> >> On Thu, May 27, 2010 at 2:10 PM,   wrote:
>> >> > Do the “sharex” and “sharey” kwargs help?
>> >> >
>> >> >
>> >> >
>> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes
>> >> >
>> >> >
>> >> >
>> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html
>> >> >
>> >> > -paul
>> >> >
>> >> >
>> >> >
>> >> > From: Adam Fraser [mailto:adam.n.fra...@gmail.com]
>> >> > Sent: Thursday, May 27, 2010 10:44 AM
>> >> > To: matplotlib-users
>> >> > Subject: [Matplotlib-users] Is there a way to link axes of imshow
>> plots?
>> >> >
>> >> >
>> >> >
>> >> > Suppose I have a figure canvas with 3 plots... 2 are images of the
>> same
>> >> > dimensions plotted with imshow, and the other is a scatterplot. I'd
>> like
>> >> > to
>> >> > be able to link the x and y axes of the imshow plots so that when I
>> zoom
>> >> > in
>> >> > one, the other zooms to the same coordinates, and when I pan in one,
>> the
>> >> > other pans as well.
>> >> >
>> >> >
>> >> >
>> >> > I started hacking my way around this by
>> >> > subclassing NavigationToolbar2WxAgg
>> >> > (shown below)... but there are several problems here.
>> >> >
>> >> > 1) This will link the axes of all plots in a canvas since all I've
>> done
>> >> > is
>> >> > get rid of the checks for a.in_axes()
>> >> >
>> >> > 2) This worked well for panning, but zooming caused all subplots to
>> zoom
>> >> > from the same global point, rather than from the same point in each
>> of
>> >> > their
>> >> > respective axes.
>> >> >
>> >> >
>> >> >
>> >> > Can anyone suggest a workaround?
>> >> >
>> >> >
>> >> >
>> >> > Much thanks!
>> >> >
>> >> > -Adam
>> >> >
>> >> >
>> >> >
>> >> > from matplotlib.backends.backend_wxagg import NavigationToolbar2WxAgg
>> as
>> >> > NavigationToolbar
>> >> >
>> >> > class MyNavToolbar(NavigationToolbar):
>> >> >
>> >> > def __init__(self, canvas, cpfig):
>> >> >
>> >> > NavigationToolbar.__init__(self, canvas)
>> >> >
>> >> >
>> >> >
>> >> > # override
>> >> >
>> >> > def press_pan(self, event):
>> >> >
>> >> > 'the press mouse button in pan/zoom mode callback'
>> >> >
>> >> >
>> >> >
>> >> > if event.button == 1:
>> >> >
>> >> > self._button_pressed=1
>> >> >
>> >> > elif  event.button == 3:
>> >> >
>> >> > self._button_pressed=3
>> >> >
>> >> > else:
>> >> >
>> >> > self._button_pressed=None
>> >> >
>> >> > return
>> >> >
>> >> >
>> >> >
>> >> > x, y = event.x, event.y
>> >> >
>> >> >
>> >> >
>> >> > # push the current view to define home if stack is empty
>> >> >
>> >> > if self._views.empty(): self.push_current()
>> >> >
>> >> >
>> >> >
>> >> > self._xypress=[]
>> >> >
>> >> > for i, a in enumerate(self.canvas.fi

Re: [matplotlib-devel] [Matplotlib-users] Is there a way to link axes of imshow plots?

2010-06-09 Thread Eric Firing
On 06/09/2010 09:58 AM, Benjamin Root wrote:
> Has anybody given any further thought to the implication of having
> Basemap set adjustable as "box-forced" instead of "box"?  So far, it has
> been working just fine for me, but I have no clue if there are any
> unintended side-effects.

My sense is that box-forced lets you shoot yourself in the foot with 
shared axes, box doesn't.  The reason I prohibited sharing x and y axes 
with adjustable as box is that it is not clear what should happen, or 
will happen--fundamental inconsistencies can arise.  Suppose you have 
two axes sharing x and y.  You set aspect to 1 for the first and 2 for 
the second.  The first axes is drawn, executing apply_aspect and setting 
the box dimensions accordingly.  Then the second is drawn, also 
executing apply_aspect.  It is inconsistent with the first.  There is no 
solution that satisfies all constraints.  The basic point is that when 
using apply_aspect with adjustable as box, you have to have freedom to 
change one of the axes, and this is not in general consistent with 
sharing both axes--though it may be in particular cases.

Very likely there is a way of refining the logic, but beware: getting 
aspect ratio control to work under a wide range of conditions, including 
all sorts of zooming and resizing, is tricky and laborious.  It is much 
easier to break it than to fix it, and the breakage can be hard to spot.

Eric

>
> Ben Root
>
>
> On Tue, Jun 1, 2010 at 6:00 PM, Benjamin Root  > wrote:
>
> Right, that is sort of what I am asking.  My thinking is that
> Basemap could use 'box-forced' instead of 'box' for the adjustable
> parameter in order to make it and AxesGrid compatible.  Usually, if
> one wants to use AxesGrid, they all should have the same domain and
> aspect ratio.  I just have no clue what sort of repricussions that
> has for other use cases.
>
> So far, this has worked just fine for me, but I hardly represent the
> normal use cases of Basemap and AxesGrid.
>
> Ben Root
>
>
> On Tue, Jun 1, 2010 at 5:20 PM, Jae-Joon Lee  > wrote:
>
> If Basemap explicitly sets aspect=1 and adjustable="box" at the same
> time, you cannot use this with any axes that shares its axis with
> others (including the axes created by the AxesGrid).
>
> You need to somehow avoid the set_aspect call with adjustable"box"
> (you can set box-forced in stead).
>
> -JJ
>
>
> On Tue, Jun 1, 2010 at 2:45 PM, Benjamin Root  > wrote:
>  >
>  > On a related note, I have noticed an incompatibility between
> AxesGrid and
>  > Basemap.  It appears that Basemap will explicitly set
> adjustable='box' when
>  > it calls ax.set_aspect(), but AxesGrid will error out, saying
> that it has to
>  > be 'datalim'.  What are the implications of using
> 'box-forced' instead of
>  > 'box' in Basemap?
>  >
>  > Ben Root
>  >
>  > On Thu, May 27, 2010 at 1:59 PM, Jae-Joon Lee
> mailto:lee.j.j...@gmail.com>> wrote:
>  >>
>  >> ax1 = subplot(121)
>  >> ax2 = subplot(122, sharex=ax1, sharey=ax1)
>  >>
>  >> ax1.set_adjustable("box-forced")
>  >> ax2.set_adjustable("box-forced")
>  >>
>  >> arr1 = np.arange(100).reshape((10, 10))
>  >> ax1.imshow(arr1)
>  >>
>  >> arr2 = np.arange(100, 0, -1).reshape((10, 10))
>  >> ax2.imshow(arr2)
>  >>
>  >> Note the use of set_adjustable("box-forced").
>  >> sharex and sharey does not get along with axes of aspect=1 &
>  >> adjustable="box".
>  >>
>  >> -JJ
>  >>
>  >>
>  >>
>  >> On Thu, May 27, 2010 at 2:10 PM,  > wrote:
>  >> > Do the “sharex” and “sharey” kwargs help?
>  >> >
>  >> >
>  >> >
> 
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.axes
>  >> >
>  >> >
>  >> >
> 
> http://matplotlib.sourceforge.net/examples/pylab_examples/shared_axis_demo.html
>  >> >
>  >> > -paul
>  >> >
>  >> >
>  >> >
>  >> > From: Adam Fraser [mailto:adam.n.fra...@gmail.com
> ]
>  >> > Sent: Thursday, May 27, 2010 10:44 AM
>  >> > To: matplotlib-users
>  >> > Subject: [Matplotlib-users] Is there a way to link axes of
> imshow plots?
>  >> >
>  >> >
>  >> >
>  >> > Suppose I have a figure canvas with 3 plots... 2 are
> images of the same
>  >> > dimensions plotted with imshow, and the other is a
> scatterplot. I'd like
>  >> > to
>  >> > be able to link th

Re: [matplotlib-devel] Patch/fix for two legend oddities/bugs

2010-06-09 Thread Benjamin Root
I was trying the patch and I realized a possible use-case that might not
have been thought of before.  Consider the situation where a user does a
scatter plot with markers of two different sizes.  Then, it isn't that
far-fetched that the user might also want to control the markerscale for
each marker in the legend.

A particular example would be that a user selected a smaller markersize for
the second scatterplot so that one could see the markers from the first
scatterplot if they share the same coordinates.  However, they may wish to
display the markers in the legend so that they have the same size.

Currently, the markerscale argument accepts only a scalar, and not a list.
I don't know how difficult it would be to modify it do that, but it is a
thought.

Ben Root

On Wed, Jun 9, 2010 at 2:23 PM, Jae-Joon Lee  wrote:

> Thanks for reporting these.
> I took a look at your patch and slight revised it (see the attached).
> While I believe that my patch is compatible to yours, it'll be great
> if you check my patch to see if I missed anything.
> I'll commit the change soon.
>
> Regards,
>
> -JJ
>
>
> On Tue, Jun 8, 2010 at 3:16 PM, Erik Tollerud 
> wrote:
> > I noticed some odd behavior in the legend and managed to track down
> > the source of the problem and make a fix (a diff against the current
> > svn is attached). Specifically, two things were fixed:
> >
> > *The "markerscale" argument for the legend seems to do nothing...  The
> > attached diff properly applies the markerscale scaling for
> > polygon/circle collections and the markers for lines with markers (but
> > NOT patches or the width of lines elements in the legend).
> >
> > *If the "scatterpoints" argument was >3, all points beyond 3
> > disappeared.  This was because the default scatteryoffset only had 3
> > entries, so if you didn't specifically overwrite this, the points
> > beyond 3 didn't appear.  I've re-worked this so that now the default
> > properly deals with a number of points other than 3.
> >
> >
> --
> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> > lucky parental unit.  See the prize list and enter to win:
> > http://p.sf.net/sfu/thinkgeek-promo
> > ___
> > Matplotlib-devel mailing list
> > Matplotlib-devel@lists.sourceforge.net
> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
> >
> >
>
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>
>
--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Is there a way to link axes of imshow plots?

2010-06-09 Thread Jae-Joon Lee
On Wed, Jun 9, 2010 at 4:18 PM, Eric Firing  wrote:
> My sense is that box-forced lets you shoot yourself in the foot with
> shared axes, box doesn't.  The reason I prohibited sharing x and y axes
> with adjustable as box is that it is not clear what should happen, or
> will happen--fundamental inconsistencies can arise.  Suppose you have
> two axes sharing x and y.  You set aspect to 1 for the first and 2 for
> the second.  The first axes is drawn, executing apply_aspect and setting
> the box dimensions accordingly.  Then the second is drawn, also
> executing apply_aspect.  It is inconsistent with the first.  There is no
> solution that satisfies all constraints.  The basic point is that when
> using apply_aspect with adjustable as box, you have to have freedom to
> change one of the axes, and this is not in general consistent with
> sharing both axes--though it may be in particular cases.
>
> Very likely there is a way of refining the logic, but beware: getting
> aspect ratio control to work under a wide range of conditions, including
> all sorts of zooming and resizing, is tricky and laborious.  It is much
> easier to break it than to fix it, and the breakage can be hard to spot.
>
> Eric
>

"box-forced" must be only used in a very limited cases when axes
sharing is okay.
For example, when both x and y axis are shared and both axes have same
aspect ratio and the original axes position of both axes have same
width and height.

Hm, maybe it is better to limit the visibility of the "box-forced"
option from normal users.

For the issue of the Basemap using

ax.set_aspect('equal',adjustable='box',anchor=self.anchor)

I think (adjustable="box") is not necessary here. Simply using

ax.set_aspect('equal',anchor=self.anchor)

should work and it will also resolve the compatibility issue with
axes_grid toolkit.

But this issue should be addressed by Jeff. I'm not quite familiar with Basemap.

Regards,

-JJ

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch/fix for two legend oddities/bugs

2010-06-09 Thread Jae-Joon Lee
I'm not very kin to implement every possible options for every possible cases.
If you need customization beyond what the current "legend" class
provide, I recommend you to use proxy artists.

http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist

I personally think that the drawing of the legend handle should be
delegated to the associated artist (but fall back to the default
behavior when not provided).

Regards,

-JJ


On Wed, Jun 9, 2010 at 4:32 PM, Benjamin Root  wrote:
> I was trying the patch and I realized a possible use-case that might not
> have been thought of before.  Consider the situation where a user does a
> scatter plot with markers of two different sizes.  Then, it isn't that
> far-fetched that the user might also want to control the markerscale for
> each marker in the legend.
>
> A particular example would be that a user selected a smaller markersize for
> the second scatterplot so that one could see the markers from the first
> scatterplot if they share the same coordinates.  However, they may wish to
> display the markers in the legend so that they have the same size.
>
> Currently, the markerscale argument accepts only a scalar, and not a list.
> I don't know how difficult it would be to modify it do that, but it is a
> thought.
>
> Ben Root
>
> On Wed, Jun 9, 2010 at 2:23 PM, Jae-Joon Lee  wrote:
>>
>> Thanks for reporting these.
>> I took a look at your patch and slight revised it (see the attached).
>> While I believe that my patch is compatible to yours, it'll be great
>> if you check my patch to see if I missed anything.
>> I'll commit the change soon.
>>
>> Regards,
>>
>> -JJ
>>
>>
>> On Tue, Jun 8, 2010 at 3:16 PM, Erik Tollerud 
>> wrote:
>> > I noticed some odd behavior in the legend and managed to track down
>> > the source of the problem and make a fix (a diff against the current
>> > svn is attached). Specifically, two things were fixed:
>> >
>> > *The "markerscale" argument for the legend seems to do nothing...  The
>> > attached diff properly applies the markerscale scaling for
>> > polygon/circle collections and the markers for lines with markers (but
>> > NOT patches or the width of lines elements in the legend).
>> >
>> > *If the "scatterpoints" argument was >3, all points beyond 3
>> > disappeared.  This was because the default scatteryoffset only had 3
>> > entries, so if you didn't specifically overwrite this, the points
>> > beyond 3 didn't appear.  I've re-worked this so that now the default
>> > properly deals with a number of points other than 3.
>> >
>> >
>> > --
>> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> > lucky parental unit.  See the prize list and enter to win:
>> > http://p.sf.net/sfu/thinkgeek-promo
>> > ___
>> > Matplotlib-devel mailing list
>> > Matplotlib-devel@lists.sourceforge.net
>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>> >
>> >
>>
>>
>> --
>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>> lucky parental unit.  See the prize list and enter to win:
>> http://p.sf.net/sfu/thinkgeek-promo
>> ___
>> Matplotlib-devel mailing list
>> Matplotlib-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>
>
>

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] [Matplotlib-users] Is there a way to link axes of imshow plots?

2010-06-09 Thread Eric Firing
On 06/09/2010 10:53 AM, Jae-Joon Lee wrote:
> On Wed, Jun 9, 2010 at 4:18 PM, Eric Firing  wrote:
>> My sense is that box-forced lets you shoot yourself in the foot with
>> shared axes, box doesn't.  The reason I prohibited sharing x and y axes
>> with adjustable as box is that it is not clear what should happen, or
>> will happen--fundamental inconsistencies can arise.  Suppose you have
>> two axes sharing x and y.  You set aspect to 1 for the first and 2 for
>> the second.  The first axes is drawn, executing apply_aspect and setting
>> the box dimensions accordingly.  Then the second is drawn, also
>> executing apply_aspect.  It is inconsistent with the first.  There is no
>> solution that satisfies all constraints.  The basic point is that when
>> using apply_aspect with adjustable as box, you have to have freedom to
>> change one of the axes, and this is not in general consistent with
>> sharing both axes--though it may be in particular cases.
>>
>> Very likely there is a way of refining the logic, but beware: getting
>> aspect ratio control to work under a wide range of conditions, including
>> all sorts of zooming and resizing, is tricky and laborious.  It is much
>> easier to break it than to fix it, and the breakage can be hard to spot.
>>
>> Eric
>>
>
> "box-forced" must be only used in a very limited cases when axes
> sharing is okay.
> For example, when both x and y axis are shared and both axes have same
> aspect ratio and the original axes position of both axes have same
> width and height.
>
> Hm, maybe it is better to limit the visibility of the "box-forced"
> option from normal users.
>
> For the issue of the Basemap using
>
>  ax.set_aspect('equal',adjustable='box',anchor=self.anchor)
>
> I think (adjustable="box") is not necessary here. Simply using
>
>  ax.set_aspect('equal',anchor=self.anchor)
>
> should work and it will also resolve the compatibility issue with
> axes_grid toolkit.
>
> But this issue should be addressed by Jeff. I'm not quite familiar with 
> Basemap.

Jeff can correct me if I am wrong, but I think adjustable='box' is 
essential for basemap because the maximum data limits are set when the 
Basemap instance is created.  In some cases the characteristics of the 
projection, and in all cases the extraction of coastlines, is set at 
instantiation time. You can zoom in to show smaller regions, but you 
don't want apply_aspect to expand the data limits beyond their initial 
values.

Eric

>
> Regards,
>
> -JJ
>
> --
> ThinkGeek and WIRED's GeekDad team up for the Ultimate
> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
> lucky parental unit.  See the prize list and enter to win:
> http://p.sf.net/sfu/thinkgeek-promo
> ___
> Matplotlib-devel mailing list
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Patch/fix for two legend oddities/bugs

2010-06-09 Thread Erik Tollerud
Jae-Joon, your patch looks to be effectively the same except for
slightly different behavior when more than 3 points are present... but
that was what was originally intended - the numpoints-> scatterpoints
was a good catch!

As for allowing an array markerscale, I agree with Jae-Joon... I think
the scatterpoints options are already stretching the limit of how
adaptable this legend is supposed to be, and it quickly becomes
confusing to match the offsets and the scalings. To be honest, I don't
see the use-case for having markerscale be different for each point
(not that there isn't a use for it, but it seems rather like a
corner-case that probably would be rather data-specific and hence more
suitable to subclassing...)


On Wed, Jun 9, 2010 at 2:05 PM, Jae-Joon Lee  wrote:
> I'm not very kin to implement every possible options for every possible cases.
> If you need customization beyond what the current "legend" class
> provide, I recommend you to use proxy artists.
>
> http://matplotlib.sourceforge.net/users/legend_guide.html#using-proxy-artist
>
> I personally think that the drawing of the legend handle should be
> delegated to the associated artist (but fall back to the default
> behavior when not provided).
>
> Regards,
>
> -JJ
>
>
> On Wed, Jun 9, 2010 at 4:32 PM, Benjamin Root  wrote:
>> I was trying the patch and I realized a possible use-case that might not
>> have been thought of before.  Consider the situation where a user does a
>> scatter plot with markers of two different sizes.  Then, it isn't that
>> far-fetched that the user might also want to control the markerscale for
>> each marker in the legend.
>>
>> A particular example would be that a user selected a smaller markersize for
>> the second scatterplot so that one could see the markers from the first
>> scatterplot if they share the same coordinates.  However, they may wish to
>> display the markers in the legend so that they have the same size.
>>
>> Currently, the markerscale argument accepts only a scalar, and not a list.
>> I don't know how difficult it would be to modify it do that, but it is a
>> thought.
>>
>> Ben Root
>>
>> On Wed, Jun 9, 2010 at 2:23 PM, Jae-Joon Lee  wrote:
>>>
>>> Thanks for reporting these.
>>> I took a look at your patch and slight revised it (see the attached).
>>> While I believe that my patch is compatible to yours, it'll be great
>>> if you check my patch to see if I missed anything.
>>> I'll commit the change soon.
>>>
>>> Regards,
>>>
>>> -JJ
>>>
>>>
>>> On Tue, Jun 8, 2010 at 3:16 PM, Erik Tollerud 
>>> wrote:
>>> > I noticed some odd behavior in the legend and managed to track down
>>> > the source of the problem and make a fix (a diff against the current
>>> > svn is attached). Specifically, two things were fixed:
>>> >
>>> > *The "markerscale" argument for the legend seems to do nothing...  The
>>> > attached diff properly applies the markerscale scaling for
>>> > polygon/circle collections and the markers for lines with markers (but
>>> > NOT patches or the width of lines elements in the legend).
>>> >
>>> > *If the "scatterpoints" argument was >3, all points beyond 3
>>> > disappeared.  This was because the default scatteryoffset only had 3
>>> > entries, so if you didn't specifically overwrite this, the points
>>> > beyond 3 didn't appear.  I've re-worked this so that now the default
>>> > properly deals with a number of points other than 3.
>>> >
>>> >
>>> > --
>>> > ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> > lucky parental unit.  See the prize list and enter to win:
>>> > http://p.sf.net/sfu/thinkgeek-promo
>>> > ___
>>> > Matplotlib-devel mailing list
>>> > Matplotlib-devel@lists.sourceforge.net
>>> > https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>> >
>>> >
>>>
>>>
>>> --
>>> ThinkGeek and WIRED's GeekDad team up for the Ultimate
>>> GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the
>>> lucky parental unit.  See the prize list and enter to win:
>>> http://p.sf.net/sfu/thinkgeek-promo
>>> ___
>>> Matplotlib-devel mailing list
>>> Matplotlib-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>>>
>>
>>
>

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] savefig options doc inconsistency

2010-06-09 Thread Jason Grout
In the "call signature" of savefig found here:

http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.savefig

it doesn't list the bbox_inches and pad_inches options, though they are 
listed in the list below the signature.

Thanks,

Jason


--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] savefig options doc inconsistency

2010-06-09 Thread John Hunter
On Wed, Jun 9, 2010 at 8:17 PM, Jason Grout  wrote:
> In the "call signature" of savefig found here:
>
> http://matplotlib.sourceforge.net/api/pyplot_api.html#matplotlib.pyplot.savefig
>
> it doesn't list the bbox_inches and pad_inches options, though they are
> listed in the list below the signature.

Thanks -- fixed in svn 8404

JDH

--
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
___
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel