[Matplotlib-users] Evolution of the interface

2013-03-15 Thread Christophe BAL
Hello,
I really appreciate the work done by matplotlib but I really think that
the interface must evolve. Here is a small example.

*object.set_something(...)*
*object.get_something()*

It could be easier to use a jQuery like style as in the following lines.

*object(...)*
*object()*

This will considerably simplify things.


Here is a more realistic example.

*fig = pylab.figure()*
*ax  = fig.add_subplot(1,1,1)*
*
*
*ax.set_xlabel(*xLabel*)*
*ax.set_ylabel(*yLabel*)*

The a jQuery like style would be as in the following lines.

*fig = pylab.figure()*
*ax  = fig.add_subplot(1,1,1)*
*
*
*ax(xlabel = *xLabel*, ylabel = *yLabel*)*
*
*
I don't know enough matplotlib to propose other examples
but I really think that there is a lot of things that could make
matplotlib much more Pythonicly easy to use.

Christophe BAL
--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread Paul Hobson
On Fri, Mar 15, 2013 at 8:01 AM, Christophe BAL projet...@gmail.com wrote:

 Hello,
 I really appreciate the work done by matplotlib but I really think that
 the interface must evolve. Here is a small example.

 *object.set_something(...)*
 *object.get_something()*

 It could be easier to use a jQuery like style as in the following lines.

 *object(...)*
 *object()*

 This will considerably simplify things.


 Here is a more realistic example.

 *fig = pylab.figure()*
 *ax  = fig.add_subplot(1,1,1)*
 *
 *
 *ax.set_xlabel(*xLabel*)*
 *ax.set_ylabel(*yLabel*)*

 The a jQuery like style would be as in the following lines.

 *fig = pylab.figure()*
 *ax  = fig.add_subplot(1,1,1)*
 *
 *
 *ax(xlabel = *xLabel*, ylabel = *yLabel*)*
 *
 *
 I don't know enough matplotlib to propose other examples
 but I really think that there is a lot of things that could make
 matplotlib much more Pythonicly easy to use.


Interesting thoughts, Christophe. There is currently a MEP to do something
similar:
https://github.com/matplotlib/matplotlib/wiki/MEP13
--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread todd rme
On Mar 15, 2013 4:01 PM, Christophe BAL projet...@gmail.com wrote:

 Hello,
 I really appreciate the work done by matplotlib but I really think that
 the interface must evolve. Here is a small example.

 object.set_something(...)
 object.get_something()

 It could be easier to use a jQuery like style as in the following lines.

 object(...)
 object()

 This will considerably simplify things.


 Here is a more realistic example.

 fig = pylab.figure()
 ax  = fig.add_subplot(1,1,1)

 ax.set_xlabel(xLabel)
 ax.set_ylabel(yLabel)

 The a jQuery like style would be as in the following lines.

 fig = pylab.figure()
 ax  = fig.add_subplot(1,1,1)

 ax(xlabel = xLabel, ylabel = yLabel)

 I don't know enough matplotlib to propose other examples
 but I really think that there is a lot of things that could make
 matplotlib much more Pythonicly easy to use.

 Christophe BAL


I don't personally like this approach. Python has very clear separation
between the initialization of methods, which acts like a function that
returns an instance, and the modification of existing instances, which uses
attributes. This syntax muddies the distinction, having something that
should behave like an instance instead behaving as a function.

Is there any precedence for using this sort of syntax in python?  I have
not seen it anywhere else. You mention jQuery, but that is JavaScript not
python. As far as I have seen
--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread Jerzy Karczmarczuk

Christophe BAL:

I really appreciate the work done by matplotlib but I really think that
the interface must evolve. Here is a small example.

*  object.set_something(...)*
*object.get_something()*

It could be easier to use a jQuery like style as in the following lines.

*object(...)*
*object()*

This will considerably simplify things.


Here is a more realistic example.

*fig = pylab.figure()*
*ax  = fig.add_subplot(1,1,1)*
*
*
*ax.set_xlabel(*xLabel*)*
*ax.set_ylabel(*yLabel*)*

The a jQuery like style would be as in the following lines.

*fig = pylab.figure()*
*ax  = fig.add_subplot(1,1,1)*
*
*
*  ax(xlabel = *xLabel*, ylabel = *yLabel*)*
*
*
I don't know enough matplotlib to propose other examples
but I really think that *there is a lot **of things that could make *
*matplotlib much more Pythonicly easy to use.*
I am afraid I disagree  a little bit. The call:  object(...) [if object 
is an instance, not a class, otherwise ths would be a constructor] -

- means object.call(...).

Now, in principle one can throw inside a generic call plenty of 
attribute changes,  but just imagine the parsing of all the possible 
argument combination. And, BTW, what would it mean: xxx= ax()  ? In 
general case this is not practical.
The methods in Python called.through.the.dot.notation are there to stay, 
I think.


Jerzy Karczmarczuk
Caen, France.


--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] mpl_toolkits axes grid

2013-03-15 Thread Christian Meesters
Hi,It is quite some time ago since I was intensively using MPL. Perhaps I will not get the terminology right anymore. And now I hope to get some pointer for this particular problem:I would like to arange some line plots using a grid from left to right in a single plot / figure instance. Each of these plots is created from vectors (numpy arrays) of a different length. If I would place subplots of equal size to place these individual plots from left to right, all will appear with a different stretch/squeeze.My question now is: Is there a way to place different subplots of different sizes automatically? For all my plots I will encounter different number of individual line plots of different size.My approach so far (pseudocode):from mpl_toolkits.axes_grid1 import Gridimport pylab as pltfig = plt.figure(1, (5.5, 3.5))grid = Grid(fig, 111, # similar to subplot(111) nrows_ncols = (1, number_of_subplots), axes_pad = 0.1, add_all=True, label_mode = L, )for index in xrange(number_of_subplots): grid[index].???And now I just do not know how to get any further? How will I get the necessary extension for each subfigure/plot? Which is the most efficient way to accomplish all this? Should I import a different class, other than Grid?TIARegards,Christian

--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread Joe Kington
On Mar 15, 2013 10:01 AM, Christophe BAL projet...@gmail.com wrote:

 Hello,
 I really appreciate the work done by matplotlib but I really think that
 the interface must evolve. Here is a small example.

 object.set_something(...)
 object.get_something()

 It could be easier to use a jQuery like style as in the following lines.

 object(...)
 object()

 This will considerably simplify things.


 Here is a more realistic example.

 fig = pylab.figure()
 ax  = fig.add_subplot(1,1,1)

 ax.set_xlabel(xLabel)
 ax.set_ylabel(yLabel)

 The a jQuery like style would be as in the following lines.

 fig = pylab.figure()
 ax  = fig.add_subplot(1,1,1)

 ax(xlabel = xLabel, ylabel = yLabel)


Just fyi: you can always do

ax.set(xlabel=something, ylabel=something)


 I don't know enough matplotlib to propose other examples
 but I really think that there is a lot of things that could make
 matplotlib much more Pythonicly easy to use.

 Christophe BAL


--
 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_d2d_mar

 ___
 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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Evolution of the interface

2013-03-15 Thread Brendan Barnwell
On 2013-03-15 08:19, Paul Hobson wrote: On Fri, Mar 15, 2013 at 8:01 
AM, Christophe BAL projet...@gmail.com wrote:
 
  Hello,
  I really appreciate the work done by matplotlib but I really think 
that
  the interface must evolve. Here is a small example.
 
  *object.set_something(...)*
  *object.get_something()*
 
  It could be easier to use a jQuery like style as in the following 
lines.
 
  *object(...)*
  *object()*

  Interesting thoughts, Christophe. There is currently a MEP to do 
something
  similar:
  https://github.com/matplotlib/matplotlib/wiki/MEP13

I think the current situation is better than this jQuery style, and 
the MEP is better than the current situation.  Using lots of verbose 
getters and setters is unpythonic, but calling objects directly in 
that catch-all way is even more unpythonic.  There are lots of things 
you might want to do to an MPL object, and we shouldn't elevate 
attribute get/set as the main one that should be accessed by the 
call syntax.

That MEP would be great, though!

-- 
Brendan Barnwell
Do not follow where the path may lead.  Go, instead, where there is 
no path, and leave a trail.
--author unknown

--
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_d2d_mar
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] mpl_toolkits axes grid

2013-03-15 Thread Benjamin Root
On Fri, Mar 15, 2013 at 12:41 PM, Christian Meesters meest...@gmx.dewrote:

 Hi,

 It is quite some time ago since I was intensively using MPL. Perhaps I
 will not get the terminology right anymore. And now I hope to get some
 pointer for this particular problem:

 I would like to arange some line plots using a grid from left to right in
 a single plot / figure instance. Each of these plots is created from
 vectors (numpy arrays) of a different length. If I would place subplots of
 equal size to place these individual plots from left to right, all will
 appear with a different stretch/squeeze.

 My question now is: Is there a way to place different subplots of
 different sizes automatically? For all my plots I will encounter different
 number of individual line plots of different size.

 My approach so far (pseudocode):

 from mpl_toolkits.axes_grid1 import Grid
 import pylab as plt

 fig  = plt.figure(1, (5.5, 3.5))
 grid = Grid(fig, 111, # similar to subplot(111)
  nrows_ncols = (1, number_of_subplots),
  axes_pad = 0.1,
  add_all=True,
  label_mode = L,
  )

 for index in xrange(number_of_subplots):
 grid[index].???

 And now I just do not know how to get any further? How will I get the
 necessary extension for each subfigure/plot? Which is the most efficient
 way to accomplish all this? Should I import a different class, other than
 Grid?


So, are you wanting them to all have the same x and y coordinates, or maybe
you want the aspect ratio to be the same?

I am not exactly quite sure what you mean by extension.

Ben Root
--
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_d2d_mar___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users