[Matplotlib-users] RFE: dictionnary of figures

2013-07-29 Thread Frédéric Parrenin
Currently, one call figures with their number in matplotlib.
If you have a code which draw a lot a different figures at different places
with some of them being optional, this is not very convenient.

One convenient way to call figure would be to use a dictionnary of figures.
Of course I could create some wrapper around matplotlib.figure function but
it would be far more convenient if such feature would be standard in
matplotlib.

Is there any plan to implement such a feature?

Best regards,

Frédéric Parrenin
--
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] how to make mat.figure.Figure.add_axes generated axes adjustable with the interactive tool?

2013-07-29 Thread Sterling Smith
Chao,

>From your description, it is clear that you are using a very customized 
>application of axes placement and design.  The only method that I see for 
>replacing your current setup with Subplots (I use the upper case to denote the 
>instances of the class, which do respond to the left/right/wspace parameters) 
>is the following (untested):
{{{
fig,axs = plt.subplots(2,3)
for i,ax in enumerate(axs.flat):

ax.plot(time,data)
ymin,ymax = ax.get_ylim()
ax.set_ylim(ymin=ymin,ymax=ymin+2*(ymax-ymin))
labels = ax.get_yticklabels()
for l in labels:
if float(l.get_text()) > ymax:
l.set_visible(False)
ax2 = ax.twinx()
ymin,ymax = ax2.get_ylim()
ax2.set_ylim(ymin=ymax-2*(ymax-ymin),ymax=ymax)
labels = ax2.get_yticklabels()
for l in labels:
if float(l.get_text()) < ymin:
l.set_visible(False)

}}}

Some of this is inspired by http://matplotlib.org/examples/api/two_scales.html 
and similar examples/applications.

Hope that helps,
Sterling

On Jul 27, 2013, at 6:10AM, ChaoYue wrote:

> Hi, thanks.
> 
> the attached is what I achieved so far. Looks quite nice.
> 
> each subplot visible now actually contains two mat.axes.Axes object (with 
> bottom and top spines invisible)
> which is created by using the fig.add_axes, before the place occupied by the 
> two axes now is actually
> only one single subplot ojbect, which is created by using fig,axs = 
> plt.subplots(2,3). something like this:
> 
> for ax in axs.flatten():
>  #some way to find the position of the two new axes
>  sub1 = fig.add_axes()
>  sub2 = fig.add_axes()
>  fig.delaxes(ax)
> 
> Now the problem is that all the original subplots have been removed, replaced 
> by 2X6 mat.axes.Axes,
> But they don't respond to any operation in the interacitve window (like, you 
> can use your mouse to select
> the left/righ/wspace etc)
> 
> I hope I am clear. thanks!
> 
> cheers,
> 
> Chao
> 
> On Fri, Jul 26, 2013 at 5:55 PM, Sterling Smith [via matplotlib] <[hidden 
> email]> wrote:
> Chao, 
> 
> You are right, fig.add_subplot does not support precise positioning.  Why 
> don't you send a picture of a sample layout you have obtained with add_axes? 
> 
> -Sterling 
> 
> On Jul 26, 2013, at 1:26AM, ChaoYue wrote: 
> 
> > Dear Sterling, 
> > 
> > thanks for your answer. The idea is that I would like to add a subplot with 
> > precise position, as in the method of fig.add_axes? 
> > Does fig.add_subplot support this, I tried 
> > fig.add_subplot(position=(0.2,0.2,0.1,0.1)) but it does not work... 
> > 
> > thanks! 
> > 
> > Chao 
> > 
> > On Thu, Jul 25, 2013 at 8:09 PM, Sterling Smith [via matplotlib] <[hidden 
> > email]> wrote:
> 
> > Chao, 
> > 
> > plt.subplots returns a figure instance.  Can you use the add_subplot method 
> > of that figure instance to make your new axes?  If so, then I think that 
> > they should respond to the new requests for left/right/bottom/wspace space. 
> > 
> > -Sterling 
> > 
> > On Jul 25, 2013, at 10:06AM, Chao YUE wrote: 
> > 
> > > Dear all, 
> > > 
> > > First I make some subplots using the plt.subplots command, 
> > > then I use mat.figure.Figure.delaxes to delete the axes, and add some 
> > > small new ones 
> > > in the same space by using mat.figure.Figure.add_axes, but I find after 
> > > rendering the 
> > > figure in the interative window, I cannot adjust the 
> > > left/right/bottom/wspace etc in a 
> > > interactive way, the old subplots that are generated using plt.subplots 
> > > command will 
> > > move, and the new ones generated using mat.figure.Figure.add_axes just 
> > > don't 
> > > move at all, so what should I do if I want the new ones also move? 
> > > Because 
> > > the interative window is really useful when you want to have figures 
> > > quickly. 
> > > 
> > > thanks a lot for any hints. 
> > > 
> > > cheers, 
> > > 
> > > Chao 
> > > 
> > > -- 
> > > ***
> > >  
> > > Chao YUE 
> > > Laboratoire des Sciences du Climat et de l'Environnement (LSCE-IPSL) 
> > > UMR 1572 CEA-CNRS-UVSQ 
> > > Batiment 712 - Pe 119 
> > > 91191 GIF Sur YVETTE Cedex 
> > > Tel: (33) 01 69 08 29 02; Fax:01.69.08.77.16 
> > > 
> > >  
> > > --
> > >  
> > > 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
> 
> > > [hidden email] 
> > > 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] 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