Re: [matplotlib-devel] Delaunay interpolator patch: support grid whose width or height is 1

2012-07-10 Thread Amit Aronovitch
On Mon, Jul 9, 2012 at 4:34 PM, Benjamin Root  wrote:

>
>
> On Sat, Jul 7, 2012 at 7:30 PM, Amit Aronovitch wrote:
>
>>
>>
<-- snipped (sent as issue #997) -->


>>
> I am always a fan of people who test and design their methods against edge
> cases like these, so my hat is off to you.
>


FTR: this was not a case of testing, but of hacking:
I had some code using scipy's delaunay interpolator, and I had to provide
fallback functionality for a machine that does not have a recent scipy
installed (luckily, it had matplotlib :-) ).
Since the sample set was irregular (not a grid) - the easiest (though
inefficient) fix was to loop over the set and use 1x1 grids. At this point
I hit this issue...


> I would suggest putting together a pull request so that we can properly
> test the potential impact such a change could have.
>
>
Done.
   thanks,

   Amit
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Time to delete backend_qt (QT3)?

2012-07-10 Thread Eric Firing
Is there any good reason *not* to delete support for Qt3 from master? 
Is anyone who is using it likely to be able to upgrade to the next mpl 
release, and yet *not* be able to install Qt4 and its bindings?  Note 
that ipython no longer supports Qt3.

Eric

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Time to delete backend_qt (QT3)?

2012-07-10 Thread Benjamin Root
On Tue, Jul 10, 2012 at 3:54 AM, Eric Firing  wrote:

> Is there any good reason *not* to delete support for Qt3 from master?
> Is anyone who is using it likely to be able to upgrade to the next mpl
> release, and yet *not* be able to install Qt4 and its bindings?  Note
> that ipython no longer supports Qt3.
>
> Eric
>
>
CentOS5 and RHEL5 both have qt3 as part of the stock install (although it
does look like qt4 is available).  CentOS6 and RHEL6 seem to have qt4 as
default, with pyqt as well.

Personally, I see no real reason to get rid of it quite yet as it doesn't
seem to be much of a support burden -- yet.  If anything, we might want to
consider putting deprecation notices for that backend in the next release.

Ben Root
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Time to delete backend_qt (QT3)?

2012-07-10 Thread Darren Dale
On Tue, Jul 10, 2012 at 8:54 AM, Benjamin Root  wrote:
>
>
> On Tue, Jul 10, 2012 at 3:54 AM, Eric Firing  wrote:
>>
>> Is there any good reason *not* to delete support for Qt3 from master?
>> Is anyone who is using it likely to be able to upgrade to the next mpl
>> release, and yet *not* be able to install Qt4 and its bindings?  Note
>> that ipython no longer supports Qt3.
>>
>> Eric
>>
>
> CentOS5 and RHEL5 both have qt3 as part of the stock install (although it
> does look like qt4 is available).  CentOS6 and RHEL6 seem to have qt4 as
> default, with pyqt as well.
>
> Personally, I see no real reason to get rid of it quite yet as it doesn't
> seem to be much of a support burden -- yet.  If anything, we might want to
> consider putting deprecation notices for that backend in the next release.

I also think its coming up on time to retire the Qt-3 backend, but
perhaps a deprecation notice in mpl-1.2 and removal in mpl-1.3 would
be appropriate. Then again, if mpl-1.2 supports python3, maybe that
would be a good time to delete the Qt3 backend, since there is no
python-3 binding for Qt3.

By the way, Qt-5 is expected in September. Hopefully it won't require
a dedicated backend, it sounds like PyQt4 will support Qt5's QtCore
and QtGui libraries.

Darren

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] Patch: more Pythonic rc handling

2012-07-10 Thread Maciek Dems
The standard RC parameters handling in Matplotlib has always troubled me. The 
syntax rc('figure.subplot', top=0.9) is not very conveniet if one wants to 
change a singe property. Direct rcParams['figure.subplot.top'] seems better 
suited in this case.

However, as the dots are already used to indicate grouping in RC, it seems 
very natural to use the syntax like:

rc.figure.subplot.top = 0.9

In my opinion this is very elegant, efficient and much Pythonic approach.

In the attachment I include a path to the current git main repo, which enables 
this way of handling RC properties. I would appreciate very much if they were 
reviewed and included in the next release of Matplotlib (the patch is not 
particularly large).

Best regrds,
Maciek

-- 
Maciek Dems http://dems.art.pl/>From a829a9d17f9c302e44309219b29855c9bafdacbd Mon Sep 17 00:00:00 2001
From: Maciek Dems 
Date: Tue, 10 Jul 2012 15:16:16 +0200
Subject: [PATCH] Added extended rc handling, enabling elegant Pythonic
 'rc.figure.subplot.left = 0.1' syntax.

---
 lib/matplotlib/__init__.py |   86 +++-
 lib/matplotlib/pyplot.py   |4 +--
 2 files changed, 70 insertions(+), 20 deletions(-)

diff --git a/lib/matplotlib/__init__.py b/lib/matplotlib/__init__.py
index 5eb9e77..61c 100644
--- a/lib/matplotlib/__init__.py
+++ b/lib/matplotlib/__init__.py
@@ -812,13 +812,39 @@ if rcParams['axes.formatter.use_locale']:
 import locale
 locale.setlocale(locale.LC_ALL, '')
 
-def rc(group, **kwargs):
+class _SubRc(object):
+def __init__(self, group):
+self.__dict__['_group'] = group
+
+def __setattr__(self, attr, value):
+name = _Rc.aliases.get(attr) or attr
+key = self._group + '.' + name
+if key not in rcParams:
+raise KeyError('Unrecognized key "%s"' % key)
+rcParams[key] = value
+
+def __getattr__(self, attr):
+name = _Rc.aliases.get(attr) or attr
+newgroup = self._group + '.' + name
+return _SubRc(newgroup)
+
+def __repr__(self):
+	if self._group not in rcParams:
+raise KeyError('Unrecognized key "%s"' % self._group)
+	return repr(rcParams[self._group])
+
+class _Rc(object):
 """
-Set the current rc params.  Group is the grouping for the rc, eg.
-for ``lines.linewidth`` the group is ``lines``, for
-``axes.facecolor``, the group is ``axes``, and so on.  Group may
-also be a list or tuple of group names, eg. (*xtick*, *ytick*).
-*kwargs* is a dictionary attribute name/value pairs, eg::
+Set the current rc params.  There are two alternative ways of using
+this object.  One is to call it like a function::
+
+  rc(group, **kwargs)
+
+Group is the grouping for the rc, eg. for ``lines.linewidth``
+the group is ``lines``, for ``axes.facecolor``, the group is ``axes``,
+and so on.  Group may also be a list or tuple of group names,
+eg. (*xtick*, *ytick*).  *kwargs* is a dictionary attribute name/value
+pairs, eg::
 
   rc('lines', linewidth=2, color='r')
 
@@ -840,6 +866,7 @@ def rc(group, **kwargs):
 'ec''edgecolor'
 'mew'   'markeredgewidth'
 'aa''antialiased'
+'sans'  'sans-serif'
 =   =
 
 Thus you could abbreviate the above rc command as::
@@ -860,6 +887,14 @@ def rc(group, **kwargs):
 This enables you to easily switch between several configurations.
 Use :func:`~matplotlib.pyplot.rcdefaults` to restore the default
 rc params after changes.
+
+Another way of using this object is to use the Python syntax like::
+
+  rc.figure.subplot.top = 0.9
+
+which is equivalent to::
+
+  rc('figure.subplot', top=0.9)
 """
 
 aliases = {
@@ -870,19 +905,36 @@ def rc(group, **kwargs):
 'ec'  : 'edgecolor',
 'mew' : 'markeredgewidth',
 'aa'  : 'antialiased',
-}
+'sans': 'sans-serif'
+}
 
-if is_string_like(group):
-group = (group,)
-for g in group:
-for k,v in kwargs.iteritems():
-name = aliases.get(k) or k
-key = '%s.%s' % (g, name)
-try:
+def __call__(self, group, **kwargs):
+if matplotlib.is_string_like(group):
+group = (group,)
+for g in group:
+for k,v in kwargs.items():
+name = _Rc.aliases.get(k) or k
+key = '%s.%s' % (g, name)
+if key not in rcParams:
+raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' %
+   (key, g, name))
 rcParams[key] = v
-except KeyError:
-raise KeyError('Unrecognized key "%s" for group "%s" and name "%s"' %
-   (key, g, name))
+
+def __setattr__(self, attr, value):
+key = _Rc.aliases.get(attr) or attr
+if key not in rcParams:
+raise KeyError('Unrecognized key "%s

[matplotlib-devel] Hacking on matplotlib

2012-07-10 Thread Amy Dyer
Hi everyone,

We're part of the summer 2012 batch at Hackerschool (www.hackerschool.com) and 
we chose to spend this week contributing to matplotlib. We already submitted a 
handful of pull requests for bugs but we are looking for more to do.

Are there any open issues or features you would like us to work on?

- Amy, Vera, Beverly and Alan
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Hacking on matplotlib

2012-07-10 Thread Benjamin Root
On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer  wrote:

> Hi everyone,
>
> We're part of the summer 2012 batch at Hackerschool (www.hackerschool.com)
> and we chose to spend this week contributing to matplotlib. We already
> submitted a handful of pull requests for bugs but we are looking for more
> to do.
>
> Are there any open issues or features you would like us to work on?
>
> - Amy, Vera, Beverly and Alan
>

Awesome!

Here is a quick list of all github issues tagged with "wishlist":

https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open

Thanks!
Ben Root
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Hacking on matplotlib

2012-07-10 Thread Mike Kaufman
On 7/10/12 4:18 PM, Benjamin Root wrote:
>
>
> On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer  > wrote:
>
> Hi everyone,
>
> We're part of the summer 2012 batch at Hackerschool
> (www.hackerschool.com ) and we chose to
> spend this week contributing to matplotlib. We already submitted a
> handful of pull requests for bugs but we are looking for more to do.
>
> Are there any open issues or features you would like us to work on?
>
> - Amy, Vera, Beverly and Alan
>
>
> Awesome!
>
> Here is a quick list of all github issues tagged with "wishlist":
>
> https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open
> 

I probably should at some point submit this as a wishlist item, but I 
thought I'd mention it here:

The other day, I was looking to make a ylabel with text of two different 
colors (I wanted to use the ylabel in a twinx rather than a legend to 
show that two of three plots on an axis used a particular scale). See also:

http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib

Unfortunately, I don't believe this solution is going to work in a 
xlabel or ylabel without finding the location of the ylabel and putting 
these concatenated text objects there.

It would be nice to have the label and title methods take a Text object 
(and a list of text objects -- each of whom could supply a piece of 
different colored text) in addition to a string.

A list of text objects would be automagically concatenated together. How 
to generalize alignment of multiple text objects? Haven't thought that 
far yet.

Either that or develop some additional color markup (and a parser) 
inside a string. Admittedly a bigger project -- though probably a better 
solution.

M

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] Hacking on matplotlib

2012-07-10 Thread Benjamin Root
On Tuesday, July 10, 2012, Mike Kaufman wrote:

> On 7/10/12 4:18 PM, Benjamin Root wrote:
> >
> >
> > On Tue, Jul 10, 2012 at 4:15 PM, Amy Dyer 
> > > wrote:
> >
> > Hi everyone,
> >
> > We're part of the summer 2012 batch at Hackerschool
> > (www.hackerschool.com ) and we chose to
> > spend this week contributing to matplotlib. We already submitted a
> > handful of pull requests for bugs but we are looking for more to do.
> >
> > Are there any open issues or features you would like us to work on?
> >
> > - Amy, Vera, Beverly and Alan
> >
> >
> > Awesome!
> >
> > Here is a quick list of all github issues tagged with "wishlist":
> >
> >
> https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open
> > <
> https://github.com/matplotlib/matplotlib/issues?labels=wishlist&page=1&state=open
> >
>
> I probably should at some point submit this as a wishlist item, but I
> thought I'd mention it here:
>
> The other day, I was looking to make a ylabel with text of two different
> colors (I wanted to use the ylabel in a twinx rather than a legend to
> show that two of three plots on an axis used a particular scale). See also:
>
>
> http://stackoverflow.com/questions/9169052/partial-coloring-of-text-in-matplotlib
>
> Unfortunately, I don't believe this solution is going to work in a
> xlabel or ylabel without finding the location of the ylabel and putting
> these concatenated text objects there.
>
> It would be nice to have the label and title methods take a Text object
> (and a list of text objects -- each of whom could supply a piece of
> different colored text) in addition to a string.
>
> A list of text objects would be automagically concatenated together. How
> to generalize alignment of multiple text objects? Haven't thought that
> far yet.
>
> Either that or develop some additional color markup (and a parser)
> inside a string. Admittedly a bigger project -- though probably a better
> solution.
>
> M
>
>
That is already a wishlist item.  Feel free to comment on its discussion
thread with your ideas.

Ben Root
--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] MacOSX backend throws exception when plotting a quadmesh

2012-07-10 Thread Patrick Marsh

Hi, All,


When trying to call plt.show() to display a generate QuadMesh using the MacOSX 
backend, an error complaining about "TypeError: only length-1 arrays can be 
converted to Python scalars" is generated. The following gist contains two 
files: 1) a self contained example that will generate the error and 2) the 
Traceback generated. For completeness, the full hash of the commit I'm using 
(pulled early today) is found in the first line of the second file.


https://gist.github.com/3087990


I should add that switching to using plt.contourf() instead of pcolormesh does 
not error. This error does not occur when using a different backend.


I submitted an issue to the issue tracker, which can be found here: 
https://github.com/matplotlib/matplotlib/issues/1006






Patrick



---
Patrick Marsh
Ph.D. Candidate / Liaison to the HWT
School of Meteorology / University of Oklahoma
Cooperative Institute for Mesoscale Meteorological Studies
National Severe Storms Laboratory
http://www.patricktmarsh.com


--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] MacOSX backend throws exception when plotting a quadmesh

2012-07-10 Thread Eric Firing
On 2012/07/10 6:44 PM, Patrick Marsh wrote:
> Hi, All,
>
> When trying to call plt.show() to display a generate QuadMesh using the
> MacOSX backend, an error complaining about "TypeError: only length-1
> arrays can be converted to Python scalars" is generated. The following
> gist contains two files: 1) a self contained example that will generate
> the error and 2) the Traceback generated. For completeness, the full
> hash of the commit I'm using (pulled early today) is found in the first
> line of the second file.
>
> https://gist.github.com/3087990
>
> I should add that switching to using plt.contourf() instead of
> pcolormesh does not error. This error does not occur when using a
> different backend.
>
> I submitted an issue to the issue tracker, which can be found here:
> https://github.com/matplotlib/matplotlib/issues/1006

Thanks, but I closed it because it is a duplicate of #996.

Eric
>
>
> Patrick
>
>
> ---
> Patrick Marsh
> Ph.D. Candidate / Liaison to the HWT
> School of Meteorology / University of Oklahoma
> Cooperative Institute for Mesoscale Meteorological Studies
> National Severe Storms Laboratory
> http://www.patricktmarsh.com
>

--
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
___
Matplotlib-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel