Re: [matplotlib-devel] gca() returns Axes

2012-08-29 Thread Jae-Joon Lee
On Wed, Aug 22, 2012 at 6:40 AM, Eric Firing  wrote:
> Correction: now I can't reproduce what I thought I was seeing; plt.gca()
> is returning an AxesSubplot as it should.  Maybe the problem is in the
> axes_grid1 toolkit.  It is appearing in the last figure of the
> tight_layout tutorial in the docs.

For axes which uses axes_locator, tight_layout works if the
axes_locator have associated subplotspec.
And, only allowing instance of SubplotBase is too strict.

The PR below addresses this issue.

https://github.com/matplotlib/matplotlib/pull/1170

And it will work again for the axes_grid1 cases.

Regards,

-JJ

--
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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] documentation error at http://matplotlib.sourceforge.net/sampledoc/custom_look.html

2012-08-29 Thread Paul Ivanov
thanks, Keith, looks like Michael fixed the apostrophe. But not the
misspelling of Eliot's last name. I've update it now.

On Tue, Aug 28, 2012 at 8:50 AM,   wrote:
> “TS Elliots’ maxim” should be “T. S. Eliot’s maxim” J
>
>
>
> Keith
>
>
>
>
>
>
> --
> 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
> Matplotlib-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-devel
>



-- 
Paul Ivanov
314 address only used for lists,  off-list direct email at:
http://pirsquared.org | GPG/PGP key id: 0x0F3E28F7

--
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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] bug in vector plotting

2012-08-29 Thread David Raymond

I think that I have found a serious bug in vector plotting (quiver)
when the "angle=xy" option is used on a plot with a large aspect
ratio.  It is my understanding that with this option, the vector with
tail at (x,y) would have its head at (x + vx,y + vy); at least this is
what it says in the documentation.

The problem is best illustrated by the following example:



#!/usr/bin/python
#
from numpy import *
import matplotlib.pyplot as plt

lx = 100.
ly = 10.
pi = 3.14159
kx = pi/lx
ky = pi/ly
nx = 21
ny = 21
x = linspace(0,lx,nx)
y = linspace(0,ly,ny)
(X,Y) = meshgrid(x,y)

# this is a streamfunction
psi = sin(kx*X)*sin(ky*Y)

# these are the velocity components derived from the streamfunction
vx = ky*sin(kx*X)*cos(ky*Y)
vy = -kx*cos(kx*X)*sin(ky*Y)

# plot the x velocity
cx = plt.contourf(x,y,vx)
b = plt.colorbar(cx, orientation='vertical')
tl = plt.title("vx")
xlab = plt.xlabel("x")
ylab = plt.ylabel("y")
plt.show()

# plot the y velocity
cy = plt.contourf(x,y,vy)
b = plt.colorbar(cy, orientation='vertical')
tl = plt.title("vy")
xlab = plt.xlabel("x")
ylab = plt.ylabel("y")
plt.show()

# plot the streamfunction and the velocity vectors using the angles=xy option
cp = plt.contour(x,y,psi)
q = plt.quiver(X,Y,vx,vy,angles='xy')
tl = plt.title("psi contours, (vx,vy) vectors")
xlab = plt.xlabel("x")
ylab = plt.ylabel("y")
plt.show()



The contour plot of vy, the y component of the vector, clearly shows
that vy is non-zero at y = 5.  However, the vector plot has it zero
along this line.  Interestingly, vx appears to be represented correctly
on the x = 50 line.  The magnitude of vectors should be inversely
proportional to the spacing of streamfunction contours, and this is
manifestly untrue in the vector plot.

Please tell me if I am doing something stupid.

Dave

PS: I am using matplotlib 1.1.1 and numpy 1.6.2 on Arch linux.  (Yes,
I have to set the #!/bin/python line in the example to #!/bin/python2
on Arch, since Arch has python3 as default!)

-- 
David J. Raymond
Prof. of Physics
New Mexico Tech
http://www.physics.nmt.edu/~raymond/index.html

--
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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] bug in vector plotting

2012-08-29 Thread Eric Firing
On 2012/08/29 10:07 AM, David Raymond wrote:
>
> I think that I have found a serious bug in vector plotting (quiver)

I think you are correct, but a quick look at the code has not yet 
revealed what is going wrong.  I will look into it.

Eric

> when the "angle=xy" option is used on a plot with a large aspect
> ratio.  It is my understanding that with this option, the vector with
> tail at (x,y) would have its head at (x + vx,y + vy); at least this is
> what it says in the documentation.
>
> The problem is best illustrated by the following example:
>
> 
>
> #!/usr/bin/python
> #
> from numpy import *
> import matplotlib.pyplot as plt
>
> lx = 100.
> ly = 10.
> pi = 3.14159
> kx = pi/lx
> ky = pi/ly
> nx = 21
> ny = 21
> x = linspace(0,lx,nx)
> y = linspace(0,ly,ny)
> (X,Y) = meshgrid(x,y)
>
> # this is a streamfunction
> psi = sin(kx*X)*sin(ky*Y)
>
> # these are the velocity components derived from the streamfunction
> vx = ky*sin(kx*X)*cos(ky*Y)
> vy = -kx*cos(kx*X)*sin(ky*Y)
>
> # plot the x velocity
> cx = plt.contourf(x,y,vx)
> b = plt.colorbar(cx, orientation='vertical')
> tl = plt.title("vx")
> xlab = plt.xlabel("x")
> ylab = plt.ylabel("y")
> plt.show()
>
> # plot the y velocity
> cy = plt.contourf(x,y,vy)
> b = plt.colorbar(cy, orientation='vertical')
> tl = plt.title("vy")
> xlab = plt.xlabel("x")
> ylab = plt.ylabel("y")
> plt.show()
>
> # plot the streamfunction and the velocity vectors using the angles=xy option
> cp = plt.contour(x,y,psi)
> q = plt.quiver(X,Y,vx,vy,angles='xy')
> tl = plt.title("psi contours, (vx,vy) vectors")
> xlab = plt.xlabel("x")
> ylab = plt.ylabel("y")
> plt.show()
>
> 
>
> The contour plot of vy, the y component of the vector, clearly shows
> that vy is non-zero at y = 5.  However, the vector plot has it zero
> along this line.  Interestingly, vx appears to be represented correctly
> on the x = 50 line.  The magnitude of vectors should be inversely
> proportional to the spacing of streamfunction contours, and this is
> manifestly untrue in the vector plot.
>
> Please tell me if I am doing something stupid.
>
> Dave
>
> PS: I am using matplotlib 1.1.1 and numpy 1.6.2 on Arch linux.  (Yes,
> I have to set the #!/bin/python line in the example to #!/bin/python2
> on Arch, since Arch has python3 as default!)
>


--
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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


Re: [matplotlib-devel] bug in vector plotting

2012-08-29 Thread Eric Firing
On 2012/08/29 10:07 AM, David Raymond wrote:
>
> I think that I have found a serious bug in vector plotting (quiver)
> when the "angle=xy" option is used on a plot with a large aspect
> ratio.  It is my understanding that with this option, the vector with
> tail at (x,y) would have its head at (x + vx,y + vy); at least this is
> what it says in the documentation.

Not a bug.
Note this in the documentation:

   *scale_units*: *None*, or any of the *units* options.
 For example, if *scale_units* is 'inches', *scale* is 2.0, and
 ``(u,v) = (1,0)``, then the vector will be 0.5 inches long.
 If *scale_units* is 'width', then the vector will be half the width
 of the axes.

 If *scale_units* is 'x' then the vector will be 0.5 x-axis
 units.  To plot vectors in the x-y plane, with u and v having
 the same units as x and y, use
 "angles='xy', scale_units='xy', scale=1".

Try this modified call to quiver:

q = plt.quiver(X, Y, vx, vy, angles='xy', scale_units='xy')

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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel


[matplotlib-devel] A sad day for our community. John Hunter: 1968-2012.

2012-08-29 Thread Fernando Perez
Dear friends and colleagues,

[please excuse a possible double-post of this message, in-flight
internet glitches]

I am terribly saddened to report that yesterday, August 28 2012 at
10am,  John D. Hunter died from complications arising from cancer
treatment at the University of Chicago hospital, after a brief but
intense battle with this terrible illness.  John is survived by his
wife Miriam, his three daughters Rahel, Ava and Clara, his sisters
Layne and Mary, and his mother Sarah.

Note: If you decide not to read any further (I know this is a long
message), please go to this page for some important information about
how you can thank John for everything he gave in a decade of generous
contributions to the Python and scientific communities:
http://numfocus.org/johnhunter.

Just a few weeks ago, John delivered his keynote address at the SciPy
2012 conference in Austin centered around the evolution of matplotlib:

http://www.youtube.com/watch?v=e3lTby5RI54

but tragically, shortly after his return home he was diagnosed with
advanced colon cancer.  This diagnosis was a terrible discovery to us
all, but John took it with his usual combination of calm and resolve,
and initiated treatment procedures.  Unfortunately, the first round of
chemotherapy treatments led to severe complications that sent him to
the intensive care unit, and despite the best efforts of the
University of Chicago medical center staff, he never fully recovered
from these.  Yesterday morning, he died peacefully at the hospital
with his loved ones at his bedside.  John fought with grace and
courage, enduring every necessary procedure with a smile on his face
and a kind word for all of his caretakers and becoming a loved patient
of the many teams that ended up involved with his case.  This was no
surprise for those of us who knew him, but he clearly left a deep and
lasting mark even amongst staff hardened by the rigors of oncology
floors and intensive care units.

I don't need to explain to this community the impact of John's work,
but allow me to briefly recap, in case this is read by some who don't
know the whole story.  In 2002, John was a postdoc at the University
of Chicago hospital working on the analysis of epilepsy seizure data
in children.  Frustrated with the state of the existing proprietary
solutions for this class of problems, he started using Python for his
work, back when the scientific Python ecosystem was much, much smaller
than it is today and this could have been seen as a crazy risk.
Furthermore, he found that there were many half-baked solutions for
data visualization in Python at the time, but none that truly met his
needs.  Undeterred, he went on to create matplotlib
(http://matplotlib.org) and thus overcome one of the key obstacles for
Python to become the best solution for open source scientific and
technical computing.  Matplotlib is both an amazing technical
achievement and a shining example of open source community building,
as John not only created its backbone but also fostered the
development of a very strong development team, ensuring that the
talent of many others could also contribute to this project.  The
value and importance of this are now painfully clear: despite having
lost John, matplotlib continues to thrive thanks to the leadership of
Michael Droetboom, the support of Perry Greenfield at the Hubble
Telescope Science Institute, and the daily work of the rest of the
team.  I want to thank Perry and Michael for putting their resources
and talent once more behind matplotlib, securing the future of the
project.

It is difficult to overstate the value and importance of matplotlib,
and therefore of John's contributions (which do not end in matplotlib,
by the way; but a biography will have to wait for another day...).
Python has become a major force in the technical and scientific
computing world, leading the open source offers and challenging
expensive proprietary platforms with large teams and millions of
dollars of resources behind them. But this would be impossible without
a solid data visualization tool that would allow both ad-hoc data
exploration and the production of complex, fine-tuned figures for
papers, reports or websites. John had the vision to make matplotlib
easy to use, but powerful and flexible enough to work in graphical
user interfaces and as a server-side library, enabling a myriad use
cases beyond his personal needs.  This means that now, matplotlib
powers everything from plots in dissertations and journal articles to
custom data analysis projects and websites.  And despite having left
his academic career a few years ago for a job in industry, he remained
engaged enough that as of today, he is still the top committer to
matplotlib; this is the git shortlog of those with more than 1000
commits to the project:

  2145  John Hunter 
  2130  Michael Droettboom 
  1060  Eric Firing 

All of this was done by a man who had three children to raise and who
still always found the time to help those o

Re: [matplotlib-devel] A sad day for our community. John Hunter: 1968-2012.

2012-08-29 Thread Jim Benson
On Wed, 29 Aug 2012, Fernando Perez wrote:

> Dear friends and colleagues,
>
> [please excuse a possible double-post of this message, in-flight
> internet glitches]
>
> I am terribly saddened to report that yesterday, August 28 2012 at
> 10am,  John D. Hunter died from complications arising from cancer
> treatment at the University of Chicago hospital, after a brief but
> intense battle with this terrible illness.  John is survived by his
> wife Miriam, his three daughters Rahel, Ava and Clara, his sisters
> Layne and Mary, and his mother Sarah.
>
> Note: If you decide not to read any further (I know this is a long
> message), please go to this page for some important information about
> how you can thank John for everything he gave in a decade of generous
> contributions to the Python and scientific communities:
> http://numfocus.org/johnhunter.
>

My apologies also for replying to the lists (double post), but the above 
web address did not work for me under Safari Version 5.1.7 (6534.57.2) 
(there was only one other post when i tried to post).
I only got a "Please complete the CAPTCHA", The message i 
attempted to post was:

"OMG! I had no idea! I too am greatly saddened! I only knew him as the 
creator of the truly great matplotlib and through the matplotlib email 
lists. This is so sad!! My sincere best wishes to his family! I too will 
be donating to his family."

Again, as Fernando said, a very sad day. I did read all of the below
info as well. Thank you Fernando for keeping the community informed, even 
on such truly sad things.

Sincerely,

Jim

  > Just a few weeks ago, John delivered his 
keynote address at the SciPy
> 2012 conference in Austin centered around the evolution of matplotlib:
>
> http://www.youtube.com/watch?v=e3lTby5RI54
>
> but tragically, shortly after his return home he was diagnosed with
> advanced colon cancer.  This diagnosis was a terrible discovery to us
> all, but John took it with his usual combination of calm and resolve,
> and initiated treatment procedures.  Unfortunately, the first round of
> chemotherapy treatments led to severe complications that sent him to
> the intensive care unit, and despite the best efforts of the
> University of Chicago medical center staff, he never fully recovered
> from these.  Yesterday morning, he died peacefully at the hospital
> with his loved ones at his bedside.  John fought with grace and
> courage, enduring every necessary procedure with a smile on his face
> and a kind word for all of his caretakers and becoming a loved patient
> of the many teams that ended up involved with his case.  This was no
> surprise for those of us who knew him, but he clearly left a deep and
> lasting mark even amongst staff hardened by the rigors of oncology
> floors and intensive care units.
>
> I don't need to explain to this community the impact of John's work,
> but allow me to briefly recap, in case this is read by some who don't
> know the whole story.  In 2002, John was a postdoc at the University
> of Chicago hospital working on the analysis of epilepsy seizure data
> in children.  Frustrated with the state of the existing proprietary
> solutions for this class of problems, he started using Python for his
> work, back when the scientific Python ecosystem was much, much smaller
> than it is today and this could have been seen as a crazy risk.
> Furthermore, he found that there were many half-baked solutions for
> data visualization in Python at the time, but none that truly met his
> needs.  Undeterred, he went on to create matplotlib
> (http://matplotlib.org) and thus overcome one of the key obstacles for
> Python to become the best solution for open source scientific and
> technical computing.  Matplotlib is both an amazing technical
> achievement and a shining example of open source community building,
> as John not only created its backbone but also fostered the
> development of a very strong development team, ensuring that the
> talent of many others could also contribute to this project.  The
> value and importance of this are now painfully clear: despite having
> lost John, matplotlib continues to thrive thanks to the leadership of
> Michael Droetboom, the support of Perry Greenfield at the Hubble
> Telescope Science Institute, and the daily work of the rest of the
> team.  I want to thank Perry and Michael for putting their resources
> and talent once more behind matplotlib, securing the future of the
> project.
>
> It is difficult to overstate the value and importance of matplotlib,
> and therefore of John's contributions (which do not end in matplotlib,
> by the way; but a biography will have to wait for another day...).
> Python has become a major force in the technical and scientific
> computing world, leading the open source offers and challenging
> expensive proprietary platforms with large teams and millions of
> dollars of resources behind them. But this would be impossible without
> a solid data visualization tool that would allow

Re: [matplotlib-devel] A sad day for our community. John Hunter: 1968-2012.

2012-08-29 Thread Fernando Perez
On Wed, Aug 29, 2012 at 8:42 PM, Jim Benson  wrote:
> My apologies also for replying to the lists (double post), but the above web
> address did not work for me under Safari Version 5.1.7 (6534.57.2) (there
> was only one other post when i tried to post).
> I only got a "Please complete the CAPTCHA", The message i attempted to post
> was:

There's a little CAPTCHA which is a little arithmetic problem.  Did
you by any chance miss that?

Cheers,

f

--
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
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel