[Matplotlib-users] useoffset=False in matplotlibrc?

2013-09-03 Thread K . -Michael Aye
Is there a way to have

ax.ticklabel_format(useOffset=False)

as default? I searched in the example matplotlibrc file but can't see 
anything that could be used?

Cheers,
Michael






--
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ANN: matplotlib 1.3.0 released

2013-08-01 Thread K . -Michael Aye

Very nice, congrats!

I was looking for some example to setup webagg but can't seem to find 
any? Is there anything written down about it?


Cheers,
Michael




On 2013-08-01 18:06:35 +, Michael Droettboom said:

On behalf of a veritable army of super coders, I'm pleased to announce 
the release of matplotlib 1.3.0.

Downloads
Downloads are available here:
http://matplotlib.org/downloads.html
as well as through pip. Check with your distro for when matplotlib 
1.3.0 will become packaged for your environment.
(Note: Mac .dmg installers are still forthcoming due to some issues 
with the new installation approach.)

Important known issues
matplotlib no longer ships with its Python dependencies, including 
dateutil, pytz, pyparsing and six. When installing from source or pip, 
pip will install these for you automatically. When installing from 
packages (on Linux distributions, MacPorts, homebrew etc.) these 
dependencies should also be handled automatically. The Windows binary 
installers do not include or install these dependencies.
You may need to remove any old matplotlib installations before 
installing 1.3.0 to ensure matplotlib has access to the latest versions 
of these dependencies.
The following backends have been removed: QtAgg (Qt version 3.x only), 
FlktAgg and Emf.
For a complete list of removed features, see 
http://matplotlib.org/api/api_changes.html#changes-in-1-3

What's new

•   xkcd-style sketch plotting
•   webagg backend for displaying and interacting with plots in a 
web browser
•   event plots
•   triangular grid interpolation
•   control of baselines in stackplot
•   many improvements to text and color handling

For a complete list of what's new, see
http://matplotlib.org/users/whats_new.html#new-in-matplotlib-1-3
Have fun, and enjoy matplotlib!
Michael Droettboom
___
NumPy-Discussion mailing list
numpy-discuss...@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion
--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] way to copy an axes object into different figures

2013-07-31 Thread K . -Michael Aye
On 2013-07-31 16:51:44 +, Jeffrey Spencer said:

> You can try fig.canvas.draw() to draw but as I have never tried the 
> above not sure whether it will work.

Also this one does not show anything, which makes me start to believe 
that the axes[0,0].set_axes(ax) could be the step that fails?


> 
> Cheers
> 
> 
> On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye 
>  wrote:
> Hi!
> 
> Is there a way to copy an axes object into different figures?
> The idea would be to first create a valuable plot, save it on its own
> into a file, and then add it to a subplots figure as part of an
> overview?
> I tried to play with this but can't make it to show up in an pylab session:
> 
> plot(arange(10))
> ax = gca()
> 
> fig, axes = subplots(2,2)
> 
> axes[0,0].set_axes(ax)
> 
> If the above is correct, how can I make it show up now? fig.show() did
> not work and fig.draw() needs an artist and a renderer which I am
> unsure where to get them from?
> 
> Any hints, or which docs to read as usual apprectiated!
> Michael
> 
> 
> 
> 
> --
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> --
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] way to copy an axes object into different figures

2013-07-31 Thread K . -Michael Aye
On 2013-07-31 17:02:12 +, Jeffrey Spencer said:

> Should have mentioned but the artist is like self in most classes so 
> really just need to pass in the renderer.
> 
> The renderer can be obtained from fig.canvas.get_renderer() so can pass 
> this to fig.draw(fig.canvas.get_renderer()). I have never done it this 
> way but should have the same results I am guessing as what I mentioned 
> above.

There was no error message, but nothing showed up either.


> 
> Cheers
> 
> 
> On Tue, Jul 30, 2013 at 10:13 AM, K.-Michael Aye 
>  wrote:
> Hi!
> 
> Is there a way to copy an axes object into different figures?
> The idea would be to first create a valuable plot, save it on its own
> into a file, and then add it to a subplots figure as part of an
> overview?
> I tried to play with this but can't make it to show up in an pylab session:
> 
> plot(arange(10))
> ax = gca()
> 
> fig, axes = subplots(2,2)
> 
> axes[0,0].set_axes(ax)
> 
> If the above is correct, how can I make it show up now? fig.show() did
> not work and fig.draw() needs an artist and a renderer which I am
> unsure where to get them from?
> 
> Any hints, or which docs to read as usual apprectiated!
> Michael
> 
> 
> 
> 
> --
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> --
> Get your SQL database under version control now!
> Version control is standard for application code, but databases havent
> caught up. So what steps can you take to put your SQL databases under
> version control? Why should you start doing it? Read more to find out.
> http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Funny basemap subplots zooming bug

2013-07-29 Thread K . -Michael Aye
I have creted two polar stereographic basemaps that look like this:

http://imgur.com/ayqINQ6

But when zooming in, this happens:

http://imgur.com/ca5OFgj

I have confirmed that this happens only for the Basemap with round=True option.

Michael




--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] way to copy an axes object into different figures

2013-07-29 Thread K . -Michael Aye
Hi!

Is there a way to copy an axes object into different figures?
The idea would be to first create a valuable plot, save it on its own 
into a file, and then add it to a subplots figure as part of an 
overview?
I tried to play with this but can't make it to show up in an pylab session:

plot(arange(10))
ax = gca()

fig, axes = subplots(2,2)

axes[0,0].set_axes(ax)

If the above is correct, how can I make it show up now? fig.show() did 
not work and fig.draw() needs an artist and a renderer which I am 
unsure where to get them from?

Any hints, or which docs to read as usual apprectiated!
Michael




--
Get your SQL database under version control now!
Version control is standard for application code, but databases havent 
caught up. So what steps can you take to put your SQL databases under 
version control? Why should you start doing it? Read more to find out.
http://pubads.g.doubleclick.net/gampad/clk?id=49501711&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] cbook.report_memory IOError

2013-07-16 Thread K . -Michael Aye
Hi!

I have just run an old code that I believe was working before on OSX.
I am trying this with matplotlib 1.2.1 on an OSX EPD running Python 2.7.3


In [1]: from matplotlib.pylab import *

In [2]: import matplotlib.cbook as cbook

In [3]: data = ones((1500,1500,3))

In [4]: imshow(data)
Out[4]: 

In [5]: ax = gca()

In [6]: print cbook.report_memory()
---
IOError   Traceback (most recent call last)
 in ()
> 1 print cbook.report_memory()

/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py
 
in report_memory(i)
   1210 elif sys.platform.startswith('darwin'):
   1211 a2 = Popen('ps -p %d -o rss,vsz' % pid, shell=True,
-> 1212stdout=PIPE).stdout.readlines()
   1213 mem = int(a2[1].split()[0])
   1214 elif sys.platform.startswith('win'):

IOError: [Errno 4] Interrupted system call

First I thought, maybe this doesn't run in IPython for a reason, but 
trying it as a script also fails:

(general_dev+)[maye@lunatic ~/Dropbox/src/pymars]$ python imshow_test.py
Traceback (most recent call last):
  File "imshow_test.py", line 7, in 
print cbook.report_memory()
  File 
"/Library/Frameworks/EPD64.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/cbook.py",
 
line 1212, in report_memory
stdout=PIPE).stdout.readlines()
IOError: [Errno 4] Interrupted system call


Is this cbook recipe maybe broken?

Best,
Michael




--
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] QT backend bug

2013-05-09 Thread K . -Michael Aye
If someone confirms this, I'd be happy to put it into github, but I 
thought I send it here first, to see if this is another PEBKAC.

Michael


On 2013-05-10 00:39:48 +, K.-Michael Aye said:

> Problem: New y-axis max value set by edit-curve interface is forgotten
> after zoom-in-zoom-out cycle.
> 
> Reproduction steps:
> 
> * change y-axis max to a larger value than used by the default layouter
> with the edit-curve interface (click on the green hook)
> * Click Ok
> * Zoom into the plot
> * click the 'Back' button and see the max on y-axis going back to the
> default value.
> 
> I would understand if the Home button goes to the default layout,
> although that's debatable, but the back button really should go to the
> previous layout, not the default layout values.
> 
> Michael
> 
> 
> 
> 
> --
> Learn Graph Databases - Download FREE O'Reilly Book
> "Graph Databases" is the definitive new guide to graph databases and
> their applications. This 200-page book is written by three acclaimed
> leaders in the field. The early access version is available now.
> Download your free book today! http://p.sf.net/sfu/neotech_d2d_may




--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] QT backend bug

2013-05-09 Thread K . -Michael Aye
Problem: New y-axis max value set by edit-curve interface is forgotten 
after zoom-in-zoom-out cycle.

Reproduction steps:

* change y-axis max to a larger value than used by the default layouter 
with the edit-curve interface (click on the green hook)
* Click Ok
* Zoom into the plot
* click the 'Back' button and see the max on y-axis going back to the 
default value.

I would understand if the Home button goes to the default layout, 
although that's debatable, but the back button really should go to the 
previous layout, not the default layout values.

Michael




--
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Basemap crash with testgdal example script

2013-04-10 Thread K . -Michael Aye
The example script 'testgdal.py' is crashing at the point of the 
basemap object instantiation:

m = Basemap(llcrnrlon=-119,llcrnrlat=22,urcrnrlon=-64,urcrnrlat=49,
projection='lcc',lat_1=33,lat_2=45,lon_0=-95)
Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286.
Abort trap: 6

Is there a known workaround?

with basemap version 1.0.2

Best,
Michael





--
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] plot_surface in pylab mode?

2013-04-01 Thread Michael Aye
On 2013-04-01 13:45:07 +, Benjamin Root said:

> 
> On Fri, Mar 29, 2013 at 7:30 PM, Michael Aye 
>  wrote:
> Is there a pylab version of ax.plot_surface?
> I am asking because the following does not work when running an ipython
> notebook in pylab mode:
> #0: #create some data ….
> #1: fig = plt.figure()
>       ax = fig.gca(projection='3d')
> #2: surf = ax.plot_surface( …..) # taking the exact command from the examples.
> 
> I have verified that this code only does NOT work when #1 and #2 are
> executed in different notebook cells. When they are combined in the
> same cell, it works.
> As I prefer the flexibility of being able to run everything anywhere, I
> am asking for pylab versions of plot_surface, as I am mostly running
> things in the pylab mode of the notebook.
> 
> Cheers,
> Michael
> 
> 
> The reason this does not work in separate cells is that a figure object 
> gets closed at the end of a ipython cell.  An ax object no longer works 
> when its parent figure is closed.  This is not limited to 3d plots.  I 
> would be surprised to see ax.plot() work if a non-3d axes object was 
> made in a different cell.

Sure, but isn't that just the reason why it doesn't work the OO-way?
That's exactly why I am asking for a pylab version of plot_surface that 
does NOT require to have a 3d axes object available already.


> 
> Ben Root
> 
> --
> Own the Future-Intel® Level Up Game Demo Contest 2013
> Rise to greatness in Intel's independent game demo contest.
> Compete for recognition, cash, and the chance to get your game
> on Steam. $5K grand prize plus 10 genre and skill prizes.
> Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Own the Future-Intel® Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest.
Compete for recognition, cash, and the chance to get your game 
on Steam. $5K grand prize plus 10 genre and skill prizes. 
Submit your demo by 6/6/13. http://p.sf.net/sfu/intel_levelupd2d
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] plot_surface in pylab mode?

2013-03-29 Thread Michael Aye
Is there a pylab version of ax.plot_surface?
I am asking because the following does not work when running an ipython 
notebook in pylab mode:
#0: #create some data ….
#1: fig = plt.figure()
  ax = fig.gca(projection='3d')
#2: surf = ax.plot_surface( …..) # taking the exact command from the examples.

I have verified that this code only does NOT work when #1 and #2 are 
executed in different notebook cells. When they are combined in the 
same cell, it works.
As I prefer the flexibility of being able to run everything anywhere, I 
am asking for pylab versions of plot_surface, as I am mostly running 
things in the pylab mode of the notebook.

Cheers,
Michael



--
Own the Future-Intel(R) Level Up Game Demo Contest 2013
Rise to greatness in Intel's independent game demo contest. Compete 
for recognition, cash, and the chance to get your game on Steam. 
$5K grand prize plus 10 genre and skill prizes. Submit your demo 
by 6/6/13. http://altfarm.mediaplex.com/ad/ck/12124-176961-30367-2
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] can't find pygtk

2012-10-18 Thread Michael Aye
On 2012-10-18 05:58:46 +, Eric Firing said:

> On 2012/10/17 6:13 PM, Michael Aye wrote:
>> I am using matplotlib 1.1.0 that came with the current EPD, which in
>> turn comes without pygtk.
>> 
>> However, the linux system I am using this on (CentOS6) has pygtk installed:
>> 
>> /usr/lib64/pygtk/2.0
>> 
>> Is there any change I can marry those two? Currently, when I try to
>> matplotlib.use('gtk')
>> I get an error
>> ImportError("Gtk* backend requires pygtk to be installed.")
>> 
>> Or do I need to recompile it into this matplotlib?
> 
> Yes, you need to recompile.  It will need to compile _backend_gdk.c,
> which needs to be able to find pygtk.h.
> 
> The plain (non-agg) gtk backend is basically unmaintained and its use is
> discouraged.

And the GTKAgg backend would have the same constraints as my current 
WxAgg, correct?

> Are you sure there isn't a reasonably easy way to do what
> you need with qt4agg, for example?  How do you want to visualize your
> million points?

Obviously there isn't place for displaying 1 million points, so I would 
expect the backend to do averaging/rebinninig/down-sampling of my data, 
depending on the current zoom level, meaning when I zoom in, it should 
repeat the averaging/rebinning/downsampling, optimized for the 
currently displayed data range. I'm aware and very willing to accept 
the delays this implies for display, but this would still be so much 
more comfortable then to write my own downsampling routines.
I would believe that many believe would agree to the simplest averaging 
routines, if only it would be possible to display large data sets at 
all.

Michael


> 
> Eric
> 
>> 
>> Thanks for your help!
>> 
>> Michael
>> 
>> PS.: The reason why I want to try GTK is actually that there are
>> reports of it being able to cope with 1 million data points, something
>> all other Agg-related backends can not do, apparently. (My linux is
>> server is definitely not the limit ;)
>> 
>> 
>> 
>> 
>> --
>> Everyone hates slow websites. So do we.
>> Make your web apps faster with AppDynamics
>> Download AppDynamics Lite for free today:
>> http://p.sf.net/sfu/appdyn_sfd2d_oct
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> --
> Everyone hates slow websites. So do we.
> Make your web apps faster with AppDynamics
> Download AppDynamics Lite for free today:
> http://p.sf.net/sfu/appdyn_sfd2d_oct




--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] can't find pygtk

2012-10-17 Thread Michael Aye
I am using matplotlib 1.1.0 that came with the current EPD, which in 
turn comes without pygtk.

However, the linux system I am using this on (CentOS6) has pygtk installed:

/usr/lib64/pygtk/2.0

Is there any change I can marry those two? Currently, when I try to
matplotlib.use('gtk')
I get an error
ImportError("Gtk* backend requires pygtk to be installed.")

Or do I need to recompile it into this matplotlib?

Thanks for your help!

Michael

PS.: The reason why I want to try GTK is actually that there are 
reports of it being able to cope with 1 million data points, something 
all other Agg-related backends can not do, apparently. (My linux is 
server is definitely not the limit ;)




--
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_sfd2d_oct
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-04 Thread Michael Aye
On 2012-10-02 20:15:51 +, Damon McDougall said:

> On Tue, Oct 2, 2012 at 9:09 PM, Eric Firing 
>  wrote:
>> On 2012/10/02 9:21 AM, Michael Aye wrote:
>>>>>>>>> 
>>>>>>>> How nice of you to ask! ;)
>>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>>> shown with some white overhead area around, e.g. for an image of 100
>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>>> and let imshow instead use the exact image extent. I believe that the
>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>>> range and not try to beautify the plot?
>>>>>>>> 
>>>>>>>> Michael
>>>>>>>> 
>>>>>>> 
>>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>> 
>>>>>> 
>>>>>> No, because it needs detail. I was looking for a boolean switch that
>>>> basically says: Respect the data, not beauty.
>>>>> 
>>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>>> that doesn't do what you want?
>>>>> 
>>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>> 
>>>> 
>>>> Which version of matplotlib are you using?  Also, are you on a 32-bit
>>>> machine or a 64-bit machine.  This might be related to a bug we have
>>>> seen recently.
>>> 
>>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>>> 
>>> Thanks for the effort Damon. I should have been starting with an
>>> example script from the beginning.
>>> I believe the problem appears only for subplots in the case of sharex
>>> =sharey = True:
>> 
>> Aha!  This is a real bug. It may take a bit of work to track it down.
>> Would you enter it, with this test script, as a github issue, please?
>> 
>> Thank you.
>> 
>> Eric
>> 
>>> 
>>> from matplotlib.pyplot import show, subplots
>>> from numpy import arange, array
>>> 
>>> arr = arange(1).reshape(100,100)
>>> l = [arr,arr,arr,arr]
>>> narr = array(l)
>>> 
>>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>>> 
>>> for ax,im in zip(axes.flatten(),narr):
>>> ax.imshow(im)
>>> 
>>> show()
>>> 
>>> One can see that all the 4 axes show the array with an extent of
>>> [-10,110, 0, 100] here.
>>> 
>>> Michael
>>> 
>>> 
>>>> 
>>>> Ben Root
>>>> 
>>>> --
>>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>>> Deploy New Relic app performance management and know exactly
>>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>>> http://p.sf.net/sfu/newrelic-dev2dev
>>>> ___
>>>> Matplotlib-users mailing list
>>>> Matplotlib-users@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>>> 
>>> 
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> wha

Re: [Matplotlib-users] imlim in ax.imshow

2012-10-04 Thread Michael Aye
On 2012-10-02 20:09:34 +, Eric Firing said:

> On 2012/10/02 9:21 AM, Michael Aye wrote:
>>>>>>>> 
>>>>>>> How nice of you to ask! ;)
>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>> shown with some white overhead area around, e.g. for an image of 100
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>> and let imshow instead use the exact image extent. I believe that the
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>> range and not try to beautify the plot?
>>>>>>> 
>>>>>>> Michael
>>>>>>> 
>>>>>> 
>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>> 
>>>>> 
>>>>> No, because it needs detail. I was looking for a boolean switch that
>>> basically says: Respect the data, not beauty.
>>>> 
>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>> that doesn't do what you want?
>>>> 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>>> Which version of matplotlib are you using?  Also, are you on a 32-bit
>>> machine or a 64-bit machine.  This might be related to a bug we have
>>> seen recently.
>> 
>> I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.
>> 
>> Thanks for the effort Damon. I should have been starting with an
>> example script from the beginning.
>> I believe the problem appears only for subplots in the case of sharex
>> =sharey = True:
> 
> Aha!  This is a real bug. It may take a bit of work to track it down.
> Would you enter it, with this test script, as a github issue, please?

Done.
https://github.com/matplotlib/matplotlib/issues/1325

Cheers,
Michael

> 
> Thank you.
> 
> Eric
> 
>> 
>> from matplotlib.pyplot import show, subplots
>> from numpy import arange, array
>> 
>> arr = arange(1).reshape(100,100)
>> l = [arr,arr,arr,arr]
>> narr = array(l)
>> 
>> fig, axes = subplots(2,2,sharex=True,sharey=True)
>> 
>> for ax,im in zip(axes.flatten(),narr):
>> ax.imshow(im)
>> 
>> show()
>> 
>> One can see that all the 4 axes show the array with an extent of
>> [-10,110, 0, 100] here.
>> 
>> Michael
>> 
>> 
>>> 
>>> Ben Root
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>>> ___
>>> Matplotlib-users mailing list
>>> Matplotlib-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>> 
> 
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
On 2012-10-02 19:49:16 +, Damon McDougall said:

> On Tue, Oct 2, 2012 at 8:33 PM, Michael Aye 
>  wrote:
>>>>>>>>>> 
>>>>>>>>> How nice of you to ask! ;)
>>>>>>>>> Indeed: I had the case that image arrays inside an ImageGrid where
>>>>>>>>> shown with some white overhead area around, e.g. for an image of 100
>>>>>>>>> pixels on the x-axis, the imshow resulted in an x-axis that went from
>>>>>>>>> -10 to 110. I was looking for a simple way to suppress that behavior
>>>>>>>>> and let imshow instead use the exact image extent. I believe that the
>>>>>>>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata
>>>>>>>>> range and not try to beautify the plot?
>>>>>>>>> 
>>>>>>>>> Michael
>>>>>>>> 
>>>>>>>> Is the 'extent' keyword what you're looking for?
>>>>>>>> 
>>>>>>> 
>>>>>>> No, because it needs detail. I was looking for a boolean switch that
>>>>>>> basically says: Respect the data, not beauty.
>>>>>> 
>>>>>> I don't understand what you mean by 'beauty'. If your image is 100
>>>>>> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
>>>>>> that doesn't do what you want?
>>>>>> 
>>>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>>>> 
>>>>> 
>>>> 
>>>> The following script works for me:
>>>> 
>>>> import numpy as np
>>>> import matplotlib.pyplot as plt
>>>> 
>>>> image = np.random.random((100,50))
>>>> 
>>>> fig = plt.figure()
>>>> ax = fig.add_subplot(1, 1, 1)
>>>> ax.imshow(image, extent=[0,100,0,50])
>>>> plt.show()
>>>> 
>>>> 
>>> 
>>> I think the problem is that Michael is using ImageGrid, and apparently
>>> it is not using the tight autoscaling that imshow normally uses by default.
>> 
>> I might have confused where I had the problem as I was trying out many
>> a'things yesterday, so today I only can reproduce it with subplots. Can
>> I activate tight autoscaling somehow? tight_layout only influences the
>> axes towards each-other not the imshows itself.
>> 
>> 
>>> 
>>> Eric
>>> 
>>> --
>>> Don't let slow site performance ruin your business. Deploy New Relic APM
>>> Deploy New Relic app performance management and know exactly
>>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>>> http://p.sf.net/sfu/newrelic-dev2dev
>> 
>> 
>> 
>> 
>> --
>> Don't let slow site performance ruin your business. Deploy New Relic APM
>> Deploy New Relic app performance management and know exactly
>> what is happening inside your Ruby, Python, PHP, Java, and .NET app
>> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
>> http://p.sf.net/sfu/newrelic-dev2dev
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> I think you may have encountered a bug, as Ben pointed out. Here's a 
> workaround:
> 
> import matplotlib
> matplotlib.use('macosx')
> import matplotlib.pyplot as plt
> from numpy import arange, array
> 
> arr = arange(1).reshape(100,100)
> l = [arr,arr,arr,arr]
> narr = array(l)
> 
> axes = []
> fig = plt.figure()
> for i in range(4):
> axes.append(fig.add_subplot(2, 2, i))
> 
> for ax, im in zip(axes, narr):
> ax.imshow(im, extent=[0,100,0,100])
> 
> plt.show()

Interestingly, providing the extent does not help using subplots.
And your way of creating the subplots does not have the bug in the 
first place. Removing the extent parameter from this still plots fine.





--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
 
>>> How nice of you to ask! ;)
>>> Indeed: I had the case that image arrays inside an ImageGrid where 
>>> shown with some white overhead area around, e.g. for an image of 100 
>>> pixels on the x-axis, the imshow resulted in an x-axis that went from 
>>> -10 to 110. I was looking for a simple way to suppress that behavior 
>>> and let imshow instead use the exact image extent. I believe that the 
>>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
>>> range and not try to beautify the plot?
>>> 
>>> Michael
>> 
>> Is the 'extent' keyword what you're looking for?
>> 
> 
> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.
 
 I don't understand what you mean by 'beauty'. If your image is 100
 pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
 that doesn't do what you want?
 
>>> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
>>> 
>>> 
>> 
>> The following script works for me:
>> 
>> import numpy as np
>> import matplotlib.pyplot as plt
>> 
>> image = np.random.random((100,50))
>> 
>> fig = plt.figure()
>> ax = fig.add_subplot(1, 1, 1)
>> ax.imshow(image, extent=[0,100,0,50])
>> plt.show()
>> 
>> 
> 
> I think the problem is that Michael is using ImageGrid, and apparently
> it is not using the tight autoscaling that imshow normally uses by default.

I might have confused where I had the problem as I was trying out many 
a'things yesterday, so today I only can reproduce it with subplots. Can 
I activate tight autoscaling somehow? tight_layout only influences the 
axes towards each-other not the imshows itself.


> 
> Eric
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread Michael Aye
> >
>  How nice of you to ask! ;)
>  Indeed: I had the case that image arrays inside an ImageGrid where 
> shown with some white overhead area around, e.g. for an image of 100 
> pixels on the x-axis, the imshow resulted in an x-axis that went from 
> -10 to 110. I was looking for a simple way to suppress that behavior 
> and let imshow instead use the exact image extent. I believe that the 
> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
> range and not try to beautify the plot?
> 
>  Michael
> 
> >>>
> >>> Is the 'extent' keyword what you're looking for?
> >>>
> >>
> >> No, because it needs detail. I was looking for a boolean switch that 
> basically says: Respect the data, not beauty.
> >
> > I don't understand what you mean by 'beauty'. If your image is 100
> > pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> > that doesn't do what you want?
> >
> As I wrote, that's not what is happening. I get extent=[-10,110,0,50].
> 
> 
> Which version of matplotlib are you using?  Also, are you on a 32-bit 
> machine or a 64-bit machine.  This might be related to a bug we have 
> seen recently.

I am using mpl 1.1.0 from EPD 7.3-2 on a 64-bit Mac OSX.

Thanks for the effort Damon. I should have been starting with an 
example script from the beginning.
I believe the problem appears only for subplots in the case of sharex 
=sharey = True:

from matplotlib.pyplot import show, subplots
from numpy import arange, array

arr = arange(1).reshape(100,100)
l = [arr,arr,arr,arr]
narr = array(l)

fig, axes = subplots(2,2,sharex=True,sharey=True)

for ax,im in zip(axes.flatten(),narr):
ax.imshow(im)

show()

One can see that all the 4 axes show the array with an extent of 
[-10,110, 0, 100] here.

Michael


> 
> Ben Root
> 
> --
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread K.-Michael Aye

On Oct 2, 2012, at 12:06 PM, Damon McDougall  wrote:

> On Tue, Oct 2, 2012 at 8:00 PM, K.-Michael Aye  wrote:
>> 
>> On Oct 2, 2012, at 11:09 AM, Damon McDougall  
>> wrote:
>> 
>>> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye  
>>> wrote:
>>>> 
>>>> 
>>>> On Oct 2, 2012, at 6:33 AM, Damon McDougall  
>>>> wrote:
>>>> 
>>>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>>>>>> 
>>>>>> 
>>>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  
>>>>>> wrote:
>>>>>>> 
>>>>>>> Hi!
>>>>>>> 
>>>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>>>> So what is it for?
>>>>>>> 
>>>>>>> Best regards,
>>>>>>> Michael
>>>>>>> 
>>>>>>> 
>>>>>> 
>>>>>> Confirmed.  I don't see imlim anywhere except in the imshow() signature. 
>>>>>>  I
>>>>>> have no recollection of this parameter, so it might be from before my 
>>>>>> time.
>>>>>> 
>>>>>> Ben Root
>>>>> 
>>>>> Is there some functionality you were looking for or were you just
>>>>> exploring the codebase?
>>>>> 
>>>> How nice of you to ask! ;)
>>>> Indeed: I had the case that image arrays inside an ImageGrid where shown 
>>>> with some white overhead area around, e.g. for an image of 100 pixels on 
>>>> the x-axis, the imshow resulted in an x-axis that went from -10 to 110. I 
>>>> was looking for a simple way to suppress that behavior and let imshow 
>>>> instead use the exact image extent. I believe that the plot command has 
>>>> such a flag, hasn't it? (I.e. to use the exact xdata range and not try to 
>>>> beautify the plot?
>>>> 
>>>> Michael
>>>> 
>>>> 
>>>>> --
>>>>> Damon McDougall
>>>>> http://www.damon-is-a-geek.com
>>>>> B2.39
>>>>> Mathematics Institute
>>>>> University of Warwick
>>>>> Coventry
>>>>> West Midlands
>>>>> CV4 7AL
>>>>> United Kingdom
>>> 
>>> Is the 'extent' keyword what you're looking for?
>>> 
>> 
>> No, because it needs detail. I was looking for a boolean switch that 
>> basically says: Respect the data, not beauty.
> 
> I don't understand what you mean by 'beauty'. If your image is 100
> pixels wide and 50 pixels tall, what is it about extent=[0,100,0,50]
> that doesn't do what you want?
> 
As I wrote, that's not what is happening. I get extent=[-10,110,0,50].


> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom


--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Fwd: imlim in ax.imshow

2012-10-02 Thread Michael Aye
On 2012-10-02 18:10:01 +, Damon McDougall said:

> Forgot to reply all. Sorry.
> 
> 
> -- Forwarded message --
> From: Damon McDougall 
> Date: Tue, Oct 2, 2012 at 7:09 PM
> Subject: Re: [Matplotlib-users] imlim in ax.imshow
> To: "K.-Michael Aye" 
> 
> 
> On Tue, Oct 2, 2012 at 5:51 PM, K.-Michael Aye 
>  wrote:
>> 
>> 
>> On Oct 2, 2012, at 6:33 AM, Damon McDougall 
>>  wrote:
>> 
>>> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root 
>>>  wrote:
>>>> 
>>>> 
>>>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye 
>>>>  wrote:
>>>>> 
>>>>> Hi!
>>>>> 
>>>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>>>> the source (status: EPD 7.3-2) it is not being used?
>>>>> So what is it for?
>>>>> 
>>>>> Best regards,
>>>>> Michael
>>>>> 
>>>>> 
>>>> 
>>>> Confirmed.  I don't see imlim anywhere except in the imshow() signature.  I
>>>> have no recollection of this parameter, so it might be from before my time.
>>>> 
>>>> Ben Root
>>> 
>>> Is there some functionality you were looking for or were you just
>>> exploring the codebase?
>>> 
>> How nice of you to ask! ;)
>> Indeed: I had the case that image arrays inside an ImageGrid where 
>> shown with some white overhead area around, e.g. for an image of 100 
>> pixels on the x-axis, the imshow resulted in an x-axis that went from 
>> -10 to 110. I was looking for a simple way to suppress that behavior 
>> and let imshow instead use the exact image extent. I believe that the 
>> plot command has such a flag, hasn't it? (I.e. to use the exact xdata 
>> range and not try to beautify the plot?
>> 
>> Michael
>> 
>> 
>>> --
>>> Damon McDougall
>>> http://www.damon-is-a-geek.com
>>> B2.39
>>> Mathematics Institute
>>> University of Warwick
>>> Coventry
>>> West Midlands
>>> CV4 7AL
>>> United Kingdom
> 
> Is the 'extent' keyword what you're looking for?

No, because it requires input. I am looking for a boolean switch that 
says something along the lines: Respect the data, not beauty. Show 
exactly like the data is.


> 
> --
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom




--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imlim in ax.imshow

2012-10-02 Thread K.-Michael Aye


On Oct 2, 2012, at 6:33 AM, Damon McDougall  wrote:

> On Tue, Oct 2, 2012 at 2:19 PM, Benjamin Root  wrote:
>> 
>> 
>> On Mon, Oct 1, 2012 at 7:20 PM, Michael Aye  wrote:
>>> 
>>> Hi!
>>> 
>>> I see that the function ax.imshow takes the parameter 'imlim' but in
>>> the source (status: EPD 7.3-2) it is not being used?
>>> So what is it for?
>>> 
>>> Best regards,
>>> Michael
>>> 
>>> 
>> 
>> Confirmed.  I don't see imlim anywhere except in the imshow() signature.  I
>> have no recollection of this parameter, so it might be from before my time.
>> 
>> Ben Root
> 
> Is there some functionality you were looking for or were you just
> exploring the codebase?
> 
How nice of you to ask! ;)
Indeed: I had the case that image arrays inside an ImageGrid where shown with 
some white overhead area around, e.g. for an image of 100 pixels on the x-axis, 
the imshow resulted in an x-axis that went from -10 to 110. I was looking for a 
simple way to suppress that behavior and let imshow instead use the exact image 
extent. I believe that the plot command has such a flag, hasn't it? (I.e. to 
use the exact xdata range and not try to beautify the plot?

Michael


> -- 
> Damon McDougall
> http://www.damon-is-a-geek.com
> B2.39
> Mathematics Institute
> University of Warwick
> Coventry
> West Midlands
> CV4 7AL
> United Kingdom

--
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] imlim in ax.imshow

2012-10-01 Thread Michael Aye
Hi!

I see that the function ax.imshow takes the parameter 'imlim' but in 
the source (status: EPD 7.3-2) it is not being used?
So what is it for?

Best regards,
Michael




--
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] fill with a semilogy axis?

2011-05-03 Thread K . -Michael Aye
A colleague posed an interesting challenge:
How to do a filled plot having the y-axis in logarithm?
I think I can do it with creating patches myself an adding it to the 
axis, but isn't there anything built-in?

Best regards,
Michael 



--
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] hist doesn't like 2d arrays

2011-02-20 Thread K . -Michael Aye
On 2011-02-18 07:32:48 +0100, Robert Abiad said:

> Dear Folks,
> 
> I'm finding that hist has problems computing on 2d arrays.
> 
> import  numpy
> import  pylab
> mu,  sigma  =  2,  0.5
> v  =  numpy.random.normal(mu,sigma,16)
> pylab.hist(v,  bins=1000,  normed=1)
> 
> This works without any problems.  But if you try this:
> 
> w=v.reshape(400,400)
> pylab.hist(w,  bins=1000,  normed=1)
> 
> it doesn't come back on my machine until all of memory is used up.  However:
> 
> n,bins = numpy.histogram(w,bins=1000,normed=1)
> 
> works just fine.

That's by design. For a n x m array, pylab.hist is doing m times a 
histogram of the n items subarray and then tries to plot them somehow 
on top of each other. The detail I don't know, but most likely you want 
to do
pylab.hist(w.flatten(), )
to get a 1-dim array that you want to fill in ONE histogram. (for 
example for image arrays).

HTH,
Michael

> 
> 
> 
> --
> The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
> Pinpoint memory and threading errors before they happen.
> Find and fix more than 250 security defects in the development cycle.
> Locate bottlenecks in serial and parallel code that limit performance.
> http://p.sf.net/sfu/intel-dev2devfeb




--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] basemap only for Earth data?

2011-02-19 Thread K . -Michael Aye
Dear all,

I wondered if there's any principle reason one should not try to use 
Basemap with other planetary data?
I am assuming, as long as projections are used that follow certain 
standards there should not be any problems, right?
Of course any of the methods like drawcountries() and so on don't make 
sense, but I guess it would be cool to have these or similar things (no 
countries on Mars yet) reimplemented for some useful things for Mars? 
Something like drawcanyons()

Please tell me if one could see an upcoming problem with this idea!

Best regards,
Michael 



--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Basemap<->GDAL library dependency (hell)?

2011-02-17 Thread K . -Michael Aye

Dear basemap team!

(I hope this is the right list for posting basemap problems? I reported 
the problem to the EPD list, but they don't have the capacity to test 
it due to the lack of GDAL installations)


There's a fatal (as in crashing Python) library dependency in relation 
with current gdal modules on the Mac. I'm using Kyngchaos' latest 
frameworks for GDAL (1.8.0)


Testcode: testgdal.py from Enthought/Examples/basemap-1.0/ (latest EPD)

This file starts with:

from osgeo import gdal, ogr
from mpl_toolkits.basemap import Basemap, cm

and when I run it like that, Python crashes with this:

Assertion failed: (0), function query, file AbstractSTRtree.cpp, line 286.
Program terminated by uncaught signal #6 after 6.80 seconds (running 
via Textmate, but same thing in ipython)


Because in the past I had some incompatibilities due to different numpy 
versions, which thanks Newton don't exist anymore (or do they?), I was 
trying around 
with the import sequences and found when I inverse these 2 like this:


from mpl_toolkits.basemap import Basemap, cm
from osgeo import gdal, ogr

the file runs perfectly.

I puth the crash report here, in case it helps:

http://dl.dropbox.com/u/139035/Basemap_crash.txt

Best regards,
Michael--
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] bus error on os x 10.6

2010-10-28 Thread K . -Michael Aye
I once had bus errors when i mixed gdal with Enthought, because gdal 
brought it's own numpy version, that didn't match Enthoughts.
In a pure pure Enthought environment where really nothing else is 
installed, this should not happen, I think.

BR,
Michael


On 2010-10-28 05:06:46 +0200, Lou Wicker said:

> Gideon Simpson  writes:
> 
>> 
>> I'm using the prebuilt OS X dmg distribution of matplotlib with
>> the mac python 2.6.4 installation on os x
>> 10.6.3.  I find that if I try to use savefig to pdf format, my
>> program terminates with a bus error.  There is no
>> such error if I save to eps format.
>> 
>> -gideon
>> 
>> ---
> ---
>> Download Intel® Parallel Studio Eval
>> Try the new software tools for yourself. Speed compiling, find bugs
>> proactively, and fine-tune applications for parallel performance.
>> See why Intel Parallel Studio got high marks during beta.
>> http://p.sf.net/sfu/intel-sw-dev
>> 
> 
> 
> Gideon:  did you ever figure this out?  I have been using the EPD
> python, and I get the same problem.  Several incantations of EPD
> do this, on both my macbook pro and mac pro.
> 
> Thanks.
> 
> Lou Wicker
> 
> 
> --
> Nokia and AT&T present the 2010 Calling All Innovators-North America contest
> Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
> $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
> Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
> http://p.sf.net/sfu/nokia-dev2dev
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users




--
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-20 Thread K . -Michael Aye
On 2010-07-16 18:48:48 +0200, Eric Firing said:

>> 
>> Furthermore,
>> deleting images from ax.images does not free memory :
> 
> Maybe because ipython is keeping a reference to every AxesImage object
> that you make...
> 
> Eric

Well, maybe, but why does it not happen for John? His penultimate post 
showed, that his iPython session does not have this problem? Is there a 
setting that might influence this apart from the hold state?

Michael



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-16 Thread K . -Michael Aye
On 2010-07-14 19:11:58 +0200, K.-Michael Aye said:

> On 2010-07-14 18:51:26 +0200, K.-Michael Aye said:
> 
>> On 2010-07-14 18:45:35 +0200, John Hunter said:
>> 
>>> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye
>>>  wrote:
>>> 
>>>> Out[12]: 1
>>>> 
>>>> In [13]: gc.collect()
>>>> 
>>>> Out[13]: 12
>>> 
>>> 
>>> still not seeing a leak in your data -- you need to report_memory
>>> after calling gc collect.  Turn off hold, add an image, call collect,
>>> report memory, the repeat several times, each time calling collect and
>>> report memory, and report the results.
>> 
>> Was just following your example, you were nowhere calling collect.
>> Here is what you requested:
>> 
>> In [1]: import gc
>> 
>> In [2]: import matplotlib.cbook as cbook
>> 
>> In [3]: data = ones((1500,1500,3))
>> 
>> In [4]: hold(False)
>> 
>> In [5]: imshow(data)
>> 
>> Out[5]: 
>> 
>> In [6]: gc.collect()
>> 
>> Out[6]: 12
>> 
>> In [7]: cbook.report_memory()
>> 
>> Out[7]: 174540
>> 
>> In [8]: imshow(data)
>> 
>> Out[8]: 
>> 
>> In [9]: gc.collect()
>> 
>> Out[9]: 0
>> 
>> In [10]: cbook.report_memory()
>> 
>> Out[10]: 253400
>> 
>> In [11]: imshow(data)
>> 
>> Out[11]: 
>> 
>> In [12]: gc.collect()
>> 
>> Out[12]: 0
>> 
>> In [13]: cbook.report_memory()
>> 
>> Out[13]: 60
>> 
>> In [14]: imshow(data)
>> 
>> Out[14]: 
>> 
>> In [15]: gc.collect()
>> 
>> Out[15]: 0
>> 
>> In [16]: cbook.report_memory()
>> 
>> Out[16]: 413296
>> 
> 
> 
> Here are the commands as macro form, for easy cut and paste into pylab:
> 
> import gc
> import matplotlib.cbook as cbook
> data = ones((1500,1500,3))
> hold(False)
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()
> imshow(data)
> gc.collect()
> cbook.report_memory()

Furthermore,
deleting images from ax.images does not free memory :

In [1]: import gc

In [2]: import matplotlib.cbook as cbook

In [3]: data = ones((1500,1500,3))

In [4]: imshow data
--> imshow(data)

Out[4]: 

In [5]: imshow data
--> imshow(data)

Out[5]: 

In [6]: imshow data
--> imshow(data)

Out[6]: 

In [7]: imshow data
--> imshow(data)

Out[7]: 

In [8]: ax =gca()

In [9]: ax.images

Out[9]:
[,
 ,
 ,
 ]

In [10]: gc.collect()

Out[10]: 15

In [11]: cbook.report_memory()

Out[11]: 414588

In [12]: del ax.images[:-1]

In [13]: gc.collect()

Out[13]: 3

In [14]: cbook.report_memory()

Out[14]: 414600




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 18:51:26 +0200, K.-Michael Aye said:

> On 2010-07-14 18:45:35 +0200, John Hunter said:
> 
>> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye
>>  wrote:
>> 
>>> Out[12]: 1
>>> 
>>> In [13]: gc.collect()
>>> 
>>> Out[13]: 12
>> 
>> 
>> still not seeing a leak in your data -- you need to report_memory
>> after calling gc collect.  Turn off hold, add an image, call collect,
>> report memory, the repeat several times, each time calling collect and
>> report memory, and report the results.
> 
> Was just following your example, you were nowhere calling collect.
> Here is what you requested:
> 
> In [1]: import gc
> 
> In [2]: import matplotlib.cbook as cbook
> 
> In [3]: data = ones((1500,1500,3))
> 
> In [4]: hold(False)
> 
> In [5]: imshow(data)
> 
> Out[5]: 
> 
> In [6]: gc.collect()
> 
> Out[6]: 12
> 
> In [7]: cbook.report_memory()
> 
> Out[7]: 174540
> 
> In [8]: imshow(data)
> 
> Out[8]: 
> 
> In [9]: gc.collect()
> 
> Out[9]: 0
> 
> In [10]: cbook.report_memory()
> 
> Out[10]: 253400
> 
> In [11]: imshow(data)
> 
> Out[11]: 
> 
> In [12]: gc.collect()
> 
> Out[12]: 0
> 
> In [13]: cbook.report_memory()
> 
> Out[13]: 60
> 
> In [14]: imshow(data)
> 
> Out[14]: 
> 
> In [15]: gc.collect()
> 
> Out[15]: 0
> 
> In [16]: cbook.report_memory()
> 
> Out[16]: 413296
> 


Here are the commands as macro form, for easy cut and paste into pylab:

import gc
import matplotlib.cbook as cbook
data = ones((1500,1500,3))
hold(False)
imshow(data)
gc.collect()
cbook.report_memory()
imshow(data)
gc.collect()
cbook.report_memory()
imshow(data)
gc.collect()
cbook.report_memory()
imshow(data)
gc.collect()
cbook.report_memory()


> 
> 
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 18:45:35 +0200, John Hunter said:

> On Wed, Jul 14, 2010 at 11:38 AM, K.-Michael Aye 
>  wrote:
> 
>> Out[12]: 1
>> 
>> In [13]: gc.collect()
>> 
>> Out[13]: 12
> 
> 
> still not seeing a leak in your data -- you need to report_memory
> after calling gc collect.  Turn off hold, add an image, call collect,
> report memory, the repeat several times, each time calling collect and
> report memory, and report the results.

Was just following your example, you were nowhere calling collect.
Here is what you requested:

In [1]: import gc

In [2]: import matplotlib.cbook as cbook

In [3]: data = ones((1500,1500,3))

In [4]: hold(False)

In [5]: imshow(data)

Out[5]: 

In [6]: gc.collect()

Out[6]: 12

In [7]: cbook.report_memory()

Out[7]: 174540

In [8]: imshow(data)

Out[8]: 

In [9]: gc.collect()

Out[9]: 0

In [10]: cbook.report_memory()

Out[10]: 253400

In [11]: imshow(data)

Out[11]: 

In [12]: gc.collect()

Out[12]: 0

In [13]: cbook.report_memory()

Out[13]: 60

In [14]: imshow(data)

Out[14]: 

In [15]: gc.collect()

Out[15]: 0

In [16]: cbook.report_memory()

Out[16]: 413296




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
>> 6 : ax.images
>> 7 : im = imshow(data)
>> 8 : ax.images
>> 9 : ax.images.remove[0]
>> 10: del ax.images.remove[0]
> 
> Both of these lines are wrong.  You either need to do
> 
>   ax.images.remove(0)  # note the parens, not square brackets
> 
> or
> 
>  del ax.images[0]

*doh*, of course, me stupid. Sorry, it's very very hot here. :)
> 
> Also, you are mixing API calls, eg
> 
>   ax = fig.add_subplot(111)
> 
> with pyplot call, eg
> 
>   im = imshow(data)
> 
> While this isn't a bug in this case, it is not good form.  The pyplot
> calls manage stateful information like current image and current axes,
> and you are safer using all pyplot or all api.  So for pure pyplot:
> 
>   subplot(111)
>   imshow(data)
> 
> or pure API:
> 
>   ax = fig.add_subplot(111)
>   ax.imshow(data)

Yeah, sorry, i thought it wouldn't matter, as i did not need an image 
object for this demo.
> 
> 
>> Even so i set hold(False), and the ax.images array does not increase,
>> the memory consumption increases.
>> 
>> I used these commands:
>> 
>> 3 : fig = figure()
>> 4 : ax = fig.add_subplot(111)
>> 5 : imshow(data)
>> 6 : ax.images
>> 7 : hold(False)
>> 8 : imshow(data)
>> 9 : ax.images
>> 
>> At step 6 I had 1 image in the ax.images array, at step 9 still only 1,
>> but RealMem went up the approx same amount between 7 and 8 then it did
>> between 4 and 5.
> 
> 
> I don't see this -- try using gc.collect() if you think you see a leak
> and use cbook.report_memory to get a measure of consumed memory.  If
> you still think you have a leak, try and build a complete
> free-standing script that replicates it.

I only can reproduce it inside a pylab session, as you see here:

IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object'. ?object also works, ?? prints more.

  Welcome to pylab, a matplotlib-based Python environment.
  For more information, type 'help(pylab)'.

In [1]: import gc

In [2]: gc.collect?
Type:   builtin_function_or_method
Base Class: 
String Form:
Namespace:  Interactive
Docstring:
collect([generation]) -> n

With no arguments, run a full collection.  The optional argument
may be an integer specifying which generation to collect.  A ValueError
is raised if the generation number is invalid.

The number of unreachable objects is returned.


In [3]: import matplotlib.cbook as cbook

In [4]: data = ones((1500,1500,3))

In [5]: imshow(data)

Out[5]: 

In [6]: ax =gca()

In [7]: cbook.report_memory()

Out[7]: 175384

In [8]: hold(False)

In [9]: len(ax.images)

Out[9]: 1

In [10]: imshow(data)

Out[10]: 

In [11]: cbook.report_memory()

Out[11]: 254624

In [12]: len(ax.images)

Out[12]: 1

In [13]: gc.collect()

Out[13]: 12


Don't know what to do with the 12 though?


If I do the same with a script like this:
from matplotlib.pylab import *
import matplotlib.cbook as cbook

data = ones((1500,1500,3))
imshow(data)
ax = gca()
print cbook.report_memory()
print len(ax.images)
hold(False)
imshow(data)
print cbook.report_memory()
print len(ax.images)
imshow(data)
print cbook.report_memory()
print len(ax.images)
imshow(data)
print cbook.report_memory()
print len(ax.images)
imshow(data)
print cbook.report_memory()
print len(ax.images)

This is what happens:
81920
1
82028
1
82128
1
82128
1
82132
1
So it's fine here.
So what's wrong with my ipython/pylab? :(

BR,
Michael



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Tip for savefig scripts and memory issues

2010-07-14 Thread K . -Michael Aye
Dear all,

just a small tip for all who are creating many images by using 
something like this:

for param in range(10):
data = get_data(param)
fig = plt.figure()
ax = fig.add_subplot(111)
im = ax.imshow(data)
fig.savefig('data_'+str(param)+'.png)
# plt.close(fig)

Unfortunately, even so the objects are created inside the loop, it 
seems they don't vanish completely from loop to loop. So, without the 
currently commented 'plt.close(fig)' you will create a huge memory leak 
(well, depending on your image sizes) that grinds even your 4GB Macbook 
Pro to a complete halt. ;)

Hopefully that helps some people out.

BR,
Michael




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-14 Thread K . -Michael Aye
On 2010-07-14 01:46:49 +0200, John Hunter said:

> On Mon, Jul 12, 2010 at 5:06 PM, K.-Michael Aye 
>  wrote:
>> On 2010-07-12 23:17:19 +0200, John Hunter said:
>> 
>>> On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye
>>>  wrote:
>>>> Dear all,
>>>> 
>>>> I'm not sure if this is by design or a problem:
> 
> It's by design and is not a leak.  matplotlib supports multiple images
> on the same axes, and can composite multiple images that overlap the
> same space using transparency, so each call to imshow is adding
> additional data to the axes.

Understood, and of course quite useful. But see below.

>  You can inspect the ax.images list to
> see the list of images is growing.
> 
> If you have an Image object and want to remove it from the Axes, call
> 
>   im.remove()


This worked.

> or you can manipulate the list of ax.images directly, eg
> 
>   del ax.images[0]

I tried this and got this error message:

In [10]: del ax.images.remove[0]
---
TypeError Traceback (most recent call last)

/Users/aye/Documents/workspace/pyrise_saver_clone/src/ 
in ()

TypeError: 'builtin_function_or_method' object does not support item deletion

Here my history of that session:

1 : from fan_finder import get_data
2 : data = get_data(2)
3 : fig = figure()
4 : ax = fig.add_subplot(111)
5 : im = imshow(data)
6 : ax.images
7 : im = imshow(data)
8 : ax.images
9 : ax.images.remove[0]
10: del ax.images.remove[0]
11: hist%
12: _ip.magic("hist ")

data is a np.array


I found another funny thing:

Even so i set hold(False), and the ax.images array does not increase, 
the memory consumption increases.

I used these commands:

3 : fig = figure()
4 : ax = fig.add_subplot(111)
5 : imshow(data)
6 : ax.images
7 : hold(False)
8 : imshow(data)
9 : ax.images

At step 6 I had 1 image in the ax.images array, at step 9 still only 1, 
but RealMem went up the approx same amount between 7 and 8 then it did 
between 4 and 5.


> 
> or if you have a single image and want to update the data in it, you can do
> 
>   im = ax.imshow(something)
>   im.set_array(newdata)
I am using this way in a GUI I programmed and works very well there.


BR,
Michael

> 
> to update the array in the existing image.
> 
> JDH
> 
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow memory leak in pylab mode?

2010-07-12 Thread K . -Michael Aye
On 2010-07-12 23:17:19 +0200, John Hunter said:

> On Mon, Jul 12, 2010 at 4:06 PM, K.-Michael Aye 
>  wrote:
>> Dear all,
>> 
>> I'm not sure if this is by design or a problem:
>> 
>> In a pylab session, if I repeatedly call imshow with the same image,
>> memory increases each time.
>> This does not happen if i go the 'Artists' way (fig = .., ax =
>> fig.add---, im = ax.imshow)
>> Is there a way to avoid memory consumption like this in the pylab style?
>> Even a clf() does not release the memory.
>> My config is the latest Enthought distribution in 32-bit mode for MacOS.
>> 
> 
> 
> Can you post a complete free-standing script that we can run which
> exposes the problem?  Also please report your version numbers -- we
> could look them up from enthought perhaps but you can help us :-)

Of course, sorry.
But because I don't know how to read out Python's memory consumption 
from within python, these lines should be run successively in Ipython, 
so that one can see, how the 'Real Mem' system indicator grows each 
time.

l = [28.1]
arr = ones((1500,1500,3))
l.append(79.7)
imshow(arr)
l.append(172.0)
imshow(arr)
l.append(249.0))
l.append(249.0)
imshow(arr)
l.append(326.3))
l.append(326.3)
imshow(arr)
l.append(404.4)
imshow(arr)
l.append(482.4)

This was run in an ipython session started with the -pylab flag.
The numbers in the l array are the MBs I read of Mac's Activity Monitor 
for the Python task.
Here is the resulting plot:
http://dl.dropbox.com/u/139035/mem_growth.png

Here's my system info:

Darwin paradigm.local 10.4.0 Darwin Kernel Version 10.4.0: Fri Apr 23 
18:28:53 PDT 2010; root:xnu-1504.7.4~1/RELEASE_I386 i386

In [25]: print matplotlib.__version__
---> print(matplotlib.__version__)
0.99.3

Enthought Python Distribution -- http://code.enthought.com

Python 2.6.5 |EPD 6.2-2 (32-bit)| (r265:79063, May 28 2010, 15:13:03)

my matplotlibrc (some adaptations):
http://dl.dropbox.com/u/139035/matplotlibrc


Hope this is all you need?

BR,
Michael


> 
> http://matplotlib.sourceforge.net/faq/troubleshooting_faq.html#troubleshooting
> 
> --
> This SF.net email is sponsored by Sprint
> What will you do first with EVO, the first 4G phone?
> Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first




--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] imshow memory leak in pylab mode?

2010-07-12 Thread K . -Michael Aye
Dear all,

I'm not sure if this is by design or a problem:

In a pylab session, if I repeatedly call imshow with the same image, 
memory increases each time.
This does not happen if i go the 'Artists' way (fig = .., ax = 
fig.add---, im = ax.imshow)
Is there a way to avoid memory consumption like this in the pylab style?
Even a clf() does not release the memory.
My config is the latest Enthought distribution in 32-bit mode for MacOS.

BR,
Michael



--
This SF.net email is sponsored by Sprint
What will you do first with EVO, the first 4G phone?
Visit sprint.com/first -- http://p.sf.net/sfu/sprint-com-first
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] savefig Memory Leak

2010-04-19 Thread K . -Michael Aye
On 2010-04-16 19:18:56 +0200, Keegan Callin said:

> Hello,
> 
> I have written a small script that, I think, demonstrates a memory leak
> in savefig.  A search of the mailing list shows a thread started by Ralf
> Gommers  about 
> 2009-07-01 that seems to
> cover a very similar issue.  I have appended the demonstration script at
> the end of this e-mail text.
> 
> [kee...@grizzly ~]$ python2.6
> Python 2.6.4 (r264:75706, Jan 20 2010, 12:34:05)
> [GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
>  >>> import matplotlib
>  >>> matplotlib.__version__
> '0.99.1.1'
> '''
> # Import standard python modules
> import sys
> import os
> from ConfigParser import SafeConfigParser as ConfigParser
> from cStringIO import StringIO
> 
> # import numpy
> import numpy
> from numpy import zeros
> 
> # Import matplotlib
> from matplotlib.figure import Figure
> from matplotlib.backends.backend_agg import FigureCanvasAgg as FigureCanvas
> 
> 
> def build_figure(a):
>  '''Returns a new figure containing array a.'''
> 
>  # Create figure and setup graph
>  fig = Figure()

Could you try to use figure() instead of Figure()? That often creates a 
mess on my side.
Or should one use Figure() in the 'Artist's style? I am still importing 
pyplot as plt, and in that case, I have to use figure(), otherwise 
things don't work.

I also had the feeling of a leak and am currently doing this without 
much 'leaking': :)

fig = plt.figure()
ax = fig.add_subplot(111)
im = ax.imshow(nData)
cb = plt.colorbar(im)
ax.set_title(bname + ', ' + mode)
fig.savefig(filename + '.equal.png')
plt.close(fig)

I think, the plt.close(fig) was quite important in my case.
Give it a try!

Best regards,
Michael




--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread K . -Michael Aye
On 2010-04-13 18:13:40 +0200, K. -Michael Aye said:

>> 
>> 
>> On 2010-04-13 10:18 AM, K. -Michael Aye wrote:
>>> Dear all,
>>> 
>>> maybe this should go to the Enthought list, but as the failure is 
>>> directly related to the pylab switch of ipython, I thought I try it 
>>> here first:
>>> 
>>> On OSX I have trouble with using the pylab switch for ipython after I 
>>> copied the gdal.pth into the Enthought site-packages folder (to be able 
>>> to use my KyngChaos GDAL Frameworks inside the Enthought Python).
>>> 
>>> The gdal.pth does the following to the sys.path:
>>> import sys; 
>>> sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')

and 
>>> 
>>> in that folder there is:
>>> 
>>> -rw-rw-r--   1 root  admin   128B  8 Feb 20:52 gdal.py
>>> -rw-r--r--   1 root  admin   274B  3 Mar 23:20 gdal.pyc
>>> -rw-rw-r--   1 root  admin   143B  8 Feb 20:52 gdalconst.py
>>> -rw-r--r--   1 root  admin   304B  3 Mar 23:20 gdalconst.pyc
>>> -rw-rw-r--   1 root  admin   147B  8 Feb 20:52 gdalnumeric.py
>>> -rw-r--r--   1 root  admin   309B  3 Mar 23:20 gdalnumeric.pyc
>>> drwxrwxr-x  42 root  admin   1.4K  3 Mar 23:20 numpy
>>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 ogr.py
>>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 ogr.pyc
>>> drwxrwxr-x  21 root  admin   714B  3 Mar 23:20 osgeo
>>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 osr.py
>>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 osr.pyc
>>> 
>>> Maybe the double import of a potentially different numpy compared to 
>>> the Enthought numpy creates the Bus Error?
>> 
>> Not so much a double import. Only one version ever gets imported, but the 
>> GDAL
>> Python bindings expect its version and matplotlib expects another version.
>> 
>>> If so, how can I avoid it?
>> 
>> You would have to rebuild the GDAL Python bindings against Enthought's numpy.
>> 
> But why does everything work fine, when I start an Enthought ipython 
> withOUT the -pylab switch?
> Importing 'from osgeo import gdal' and using it works fine in this case 
> (Tried ReadAsArray from a gdal dataset and imshow'ed it without 
> problems, apart from that I had to call show() because of the lack of 
> the -pylab switch, but other than that, fine).

Sorry, seems that I had messed up my config somehow, now GDAL does not 
work anymore inside the EPD Python. Hmm, have to make some clean 
tests...

> 
> PS.: Sorry for the mail-list noob question, but how can I nicely reply 
> to your answer like you replied to my question, with 'Robert Kern 
> wrote' and so on? There's no reply possible on sourceforge and the 
> digest contains obviously many emails, so how do you do this? ;)

Trying Unison via the GMane NNTP now, but weird that nabble has your 
last answer already for long time, whereas GMane still does not show 
it. Does the NNTP pull the mailing lists on a low frequency.
Man, I think it's 10 years ago or so since I have used NNTP. Used it a 
lot in my first net years, 94/95 ;)
Thanks for the GMane tip, the nabble reply web interface does not even 
quote properly, very strange thing, or i do something wrong.



--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread K. -Michael Aye
> 
> On 2010-04-13 10:18 AM, K. -Michael Aye wrote:
>> Dear all,
>> 
>> maybe this should go to the Enthought list, but as the failure is directly 
>> related to the pylab switch of ipython, I thought I try it here first:
>> 
>> On OSX I have trouble with using the pylab switch for ipython after I copied 
>> the gdal.pth into the Enthought site-packages folder (to be able to use my 
>> KyngChaos GDAL Frameworks inside the Enthought Python).
>> 
>> The gdal.pth does the following to the sys.path:
>> import sys; 
>> sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')
>> 
>> and in that folder there is:
>> 
>> -rw-rw-r--   1 root  admin   128B  8 Feb 20:52 gdal.py
>> -rw-r--r--   1 root  admin   274B  3 Mar 23:20 gdal.pyc
>> -rw-rw-r--   1 root  admin   143B  8 Feb 20:52 gdalconst.py
>> -rw-r--r--   1 root  admin   304B  3 Mar 23:20 gdalconst.pyc
>> -rw-rw-r--   1 root  admin   147B  8 Feb 20:52 gdalnumeric.py
>> -rw-r--r--   1 root  admin   309B  3 Mar 23:20 gdalnumeric.pyc
>> drwxrwxr-x  42 root  admin   1.4K  3 Mar 23:20 numpy
>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 ogr.py
>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 ogr.pyc
>> drwxrwxr-x  21 root  admin   714B  3 Mar 23:20 osgeo
>> -rw-rw-r--   1 root  admin   125B  8 Feb 20:52 osr.py
>> -rw-r--r--   1 root  admin   286B  3 Mar 23:20 osr.pyc
>> 
>> Maybe the double import of a potentially different numpy compared to the 
>> Enthought numpy creates the Bus Error?
> 
> Not so much a double import. Only one version ever gets imported, but the 
> GDAL 
> Python bindings expect its version and matplotlib expects another version.
> 
>> If so, how can I avoid it?
> 
> You would have to rebuild the GDAL Python bindings against Enthought's numpy.
> 
But why does everything work fine, when I start an Enthought ipython withOUT 
the -pylab switch? 
Importing 'from osgeo import gdal' and using it works fine in this case (Tried 
ReadAsArray from a gdal dataset and imshow'ed it without problems, apart from 
that I had to call show() because of the lack of the -pylab switch, but other 
than that, fine).


PS.: Sorry for the mail-list noob question, but how can I nicely reply to your 
answer like you replied to my question, with 'Robert Kern wrote' and so on? 
There's no reply possible on sourceforge and the digest contains obviously many 
emails, so how do you do this? ;)



--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] ipython pylab switch, GDAL, Enthought

2010-04-13 Thread K. -Michael Aye
Dear all,

maybe this should go to the Enthought list, but as the failure is directly 
related to the pylab switch of ipython, I thought I try it here first:

On OSX I have trouble with using the pylab switch for ipython after I copied 
the gdal.pth into the Enthought site-packages folder (to be able to use my 
KyngChaos GDAL Frameworks inside the Enthought Python).

The gdal.pth does the following to the sys.path:
import sys; 
sys.path.insert(0,'/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages')

and in that folder there is:

-rw-rw-r--   1 root  admin   128B  8 Feb 20:52 gdal.py
-rw-r--r--   1 root  admin   274B  3 Mar 23:20 gdal.pyc
-rw-rw-r--   1 root  admin   143B  8 Feb 20:52 gdalconst.py
-rw-r--r--   1 root  admin   304B  3 Mar 23:20 gdalconst.pyc
-rw-rw-r--   1 root  admin   147B  8 Feb 20:52 gdalnumeric.py
-rw-r--r--   1 root  admin   309B  3 Mar 23:20 gdalnumeric.pyc
drwxrwxr-x  42 root  admin   1.4K  3 Mar 23:20 numpy
-rw-rw-r--   1 root  admin   125B  8 Feb 20:52 ogr.py
-rw-r--r--   1 root  admin   286B  3 Mar 23:20 ogr.pyc
drwxrwxr-x  21 root  admin   714B  3 Mar 23:20 osgeo
-rw-rw-r--   1 root  admin   125B  8 Feb 20:52 osr.py
-rw-r--r--   1 root  admin   286B  3 Mar 23:20 osr.pyc

Maybe the double import of a potentially different numpy compared to the 
Enthought numpy creates the Bus Error?
If so, how can I avoid it?

For a complete picture, here is my sys.path:

['',
 '/Library/Frameworks/Python.framework/Versions/6.1/bin',
 '/Users/aye/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/pydot-1.0.2-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/pyparsing-1.5.2-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/simplejson-2.0.9-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/python_twitter-0.6-py2.6.egg',
 
'/Users/aye/Library/Python/2.6/site-packages/PIL-1.1.7-py2.6-macosx-10.6-universal.egg',
 '/Users/aye/Library/Python/2.6/site-packages/Sphinx-0.6.3-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/docutils-0.6-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/Jinja2-2.2.1-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/Pygments-1.1.1-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/spyder-1.0.3-py2.6.egg',
 
'/Users/aye/Library/Python/2.6/site-packages/scikits.image-0.2.2-py2.6-macosx-10.5-i386.egg',
 
'/Users/aye/Library/Python/2.6/site-packages/PyXML-0.8.4-py2.6-macosx-10.6-universal.egg',
 '/Users/aye/Library/Python/2.6/site-packages/pyfo-0.6-py2.6.egg',
 
'/Users/aye/Library/Python/2.6/site-packages/Amara-2.0a4-py2.6-macosx-10.6-universal.egg',
 '/Users/aye/Library/Python/2.6/site-packages/setuptools-0.6c11-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/distribute-0.6.10-py2.6.egg',
 '/Users/aye/Library/Python/2.6/site-packages/pip-0.6.3-py2.6.egg',
 '/Library/Frameworks/GDAL.framework/Versions/1.7/Python/site-packages',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python26.zip',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-darwin',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-mac',
 
'/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/plat-mac/lib-scriptpackages',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-tk',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-old',
 '/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/lib-dynload',
 
'/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/PIL',
 
'/Library/Frameworks/Python.framework/Versions/6.1/lib/python2.6/site-packages/setuptools-0.6c11-py2.6.egg-info',
 '/Users/aye/Library/Python/2.6/site-packages',
 '/Users/aye/Library/Python/2.6/site-packages/PIL',
 
'/Users/aye/Library/Python/2.6/site-packages/ipython-0.10-py2.6.egg/IPython/Extensions',
 u'/Users/aye/.ipython']

I am grateful for any hint how to make the -pylab switch working again in this 
scenario.

Best regards,
Michael



--
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users