Re: [Matplotlib-users] Newbie question - executing commands from a string

2013-08-10 Thread gsal
Hhhhmmm...what exactly do you have in mind? Sure, many of the steps to plot something are the same; to be sure, the data changes and possibly the type of plot... what kind of application are you writing? how much freedom do you really want to give to the user? is the plot specific enough? given th

Re: [Matplotlib-users] Newbie-question: spines with arrows

2012-06-18 Thread Asbach, Mark
Hi Joe, hi Daniel, Am 17.06.2012 um 19:31 schrieb Joe Kington: > It sounds like you were using the right approach, you just got a bit lost on > what some of the keyword parameters to annotate, etc do. > > Here's an example that should do what you want: > > import matplotlib.pyplot as plt > fro

Re: [Matplotlib-users] Newbie-question: spines with arrows

2012-06-17 Thread Joe Kington
It sounds like you were using the right approach, you just got a bit lost on what some of the keyword parameters to annotate, etc do. Here's an example that should do what you want: import matplotlib.pyplot as plt from matplotlib.ticker import MultipleLocator fig, ax = plt.subplots() # Set the

Re: [Matplotlib-users] Newbie-question: spines with arrows

2012-06-17 Thread Arnaldo Russo
Hi Mark, I really didn't tested anything about yours sketch... But I think "AxisArtist" could be of any help. http://matplotlib.sourceforge.net/mpl_toolkits/axes_grid/users/overview.html#axisartist Good luck. Cheers, Arnaldo. --- *Arnaldo D'Amaral Pereira Granja Russo* Lab. de Estudos dos Oceano

[Matplotlib-users] Newbie-question: spines with arrows

2012-06-15 Thread Asbach, Mark
Hi there, I'm sorry to ask such a newbie question, but I'd like to format a custom box plot and although there are numerous examples on the web and tons of docstrings in matplotlib, I'm stuck somehow. My problems center around axes / spines. In detail, my problems are: 1) I want an y-axis on t

Re: [Matplotlib-users] Newbie question

2011-11-09 Thread Joe Kington
On Wed, Nov 9, 2011 at 10:20 AM, Howard wrote: > On 11/9/11 11:13 AM, Joe Kington wrote: > > On Wed, Nov 9, 2011 at 10:07 AM, Howard wrote: > >> Hi all >> >> I'm a new user to matplotlib, and I'm having a little difficulty with >> something I feel must be basic. When I plot our data, I'm using

Re: [Matplotlib-users] Newbie question

2011-11-09 Thread Howard
On 11/9/11 11:20 AM, Howard wrote: On 11/9/11 11:13 AM, Joe Kington wrote: On Wed, Nov 9, 2011 at 10:07 AM, Howard > wrote: Hi all I'm a new user to matplotlib, and I'm having a little difficulty with something I feel must be basic. When I plot our data, I'

Re: [Matplotlib-users] Newbie question

2011-11-09 Thread Howard
On 11/9/11 11:13 AM, Joe Kington wrote: On Wed, Nov 9, 2011 at 10:07 AM, Howard > wrote: Hi all I'm a new user to matplotlib, and I'm having a little difficulty with something I feel must be basic. When I plot our data, I'm using a canvas that is 4"x4" a

Re: [Matplotlib-users] Newbie question

2011-11-09 Thread Joe Kington
On Wed, Nov 9, 2011 at 10:07 AM, Howard wrote: > Hi all > > I'm a new user to matplotlib, and I'm having a little difficulty with > something I feel must be basic. When I plot our data, I'm using a canvas > that is 4"x4" at 128 DPI and saving the canvas as a png. Here's the basics > of the code

[Matplotlib-users] Newbie question

2011-11-09 Thread Howard
Hi all I'm a new user to matplotlib, and I'm having a little difficulty with something I feel must be basic. When I plot our data, I'm using a canvas that is 4"x4" at 128 DPI and saving the canvas as a png. Here's the basics of the code: imageWidth = 4 imageHeight = 4 DPI = 128

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Nico Schlömer
> So what is it you're trying to accomplish? Maybe there is a better way. Well, I'm recursively iterating through the children of all objects, starting at gcf() (and then picking up gca(), lines, axes, everything that belongs to the plot), which is then parsed and a TikZ file is spit out. I need t

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Christopher Barker
> As for not being able to do "isinstance(gca(), > matplotlib.axes.SubplotAxes)" -- I'm not sure that's a problem. It > would help to understand the use case, but I suspect you either want > "isinstance(gca(), matplotlib.axes.Axes)" or "isinstance(gca(), > matplotlib.axes.SubplotBase)". You

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Michael Droettboom
Matthias Michler wrote: > I would expect that the case of the Subplot-objects is somehow singular and > all other mpl-objects can be classified using type and isinstance, but I'm > not an mpl-expert and maybe there are more special cases. > Yes. This weirdness came about because Subplot used

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Matthias Michler
Hi Nico, On Tuesday 12 January 2010 12:26:01 Nico Schlömer wrote: > Well, I guess that's good enough for me. :) Just to share my knowlegde with you: I found In [18]: matplotlib.axes.Subplot.__bases__ Out[18]: (, ) That is the class 'matplotlib.axes.Subplot' was inherited from SubplotBase and

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Nico Schlömer
Well, I guess that's good enough for me. :) It's a bit unfortunate that the type() function wouldn't spit out this information, though. When for example iterating through the output of get_children() (iterating through a list of objects of unknown classes that is), would there be any other way (fu

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Damon McDougall
Hi Nico, If you're using IPython then you can do a cool trick. Say your your instantiation is called var. You can type: var? and it'll spit out some info about the object, including what it's an instance of. If you type var?? it'll try to print out more detailed information. Hope that helps

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Matthias Michler
Hi Nico, I'm sorry I cannot help you, but at least I'd like to share my findings with you: I find the following statements to be true: isinstance(gca(), matplotlib.axes.SubplotBase) isinstance(gca(), matplotlib.axes.Subplot) isinstance(gca(), matplotlib.axes.Axes) but there is no class 'AxesSubpl

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Nico Schlömer
Hm. print type( gca() ) print gca().__class__ print isinstance( gca(), matplotlib.axes.AxesSubplots) yields Traceback (most recent call last): File "./testfunctions.py", line 13, in print isinstance( a, matplotlib.axes.AxesSubplots) AttributeError: 'module' object has no attribute 'Axes

Re: [Matplotlib-users] newbie question: type check?

2010-01-12 Thread Joshua J. Kugler
On Monday 11 January 2010, Nico Schlömer elucidated thus: > quick question from a Python noob: > Suppose I have an instance of an object of matplotlib, Is there any > way to check on its type, e.g., whether it is an instance of > matplotlib.axes.AxesSubplots? Python's built-in 'isintance.' isinst

[Matplotlib-users] newbie question: type check?

2010-01-11 Thread Nico Schlömer
Hi, quick question from a Python noob: Suppose I have an instance of an object of matplotlib, Is there any way to check on its type, e.g., whether it is an instance of matplotlib.axes.AxesSubplots? Cheers! Nico -- This S

Re: [Matplotlib-users] [Newbie] question concerning color mapping

2009-11-28 Thread Pierre de Buyl
Hello, the np.random.randn() functions returns a list (or an array if given appropriate arguments) of normal distributed numbers. If x and y are also of length 100, each couple (x[i],y[i]) will be assigned a size size[i] and a color colours[i]. This happens not at all because of magic, but b

[Matplotlib-users] [Newbie] question concerning color mapping

2009-11-26 Thread David
Dear list, I recently came across the following code: In [7]: size = 50*np.random.randn(100) In [8]: colours = np.random.rand(100) In [9]: scatter(x, y, s=size, c=colours); In [10]: show() which works beautifully. My question though is this: why? I came to understand, with Google's help, that t

Re: [Matplotlib-users] Newbie question

2009-06-12 Thread Eric Firing
jorgesmbox...@yahoo.es wrote: > > > > > - Mensaje original >> De: Eric Firing >> >> import matplotlib.cbook as cbook >> >> def to_sequence(arg): >> if cbook.is_iterable(arg): I goofed. It should be cbook.iterable(arg). Eric -

Re: [Matplotlib-users] Newbie question

2009-06-12 Thread jorgesmbox-ml
- Mensaje original > De: Eric Firing > > import matplotlib.cbook as cbook > > def to_sequence(arg): > if cbook.is_iterable(arg): > return arg > return [arg] > > Above is an example of how one can turn a scalar into a sequence (a list, in > this case) if necessary.

Re: [Matplotlib-users] Newbie question

2009-06-11 Thread Eric Firing
jorgesmbox...@yahoo.es wrote: > > Hi, The matplotlib.collections.Collection documentation reads: "All > properties in a collection must be sequences or scalars; if scalars, > they will be converted to sequences. The property of the ith element > of the collection is: prop[i % len(props)]". I had

[Matplotlib-users] Newbie question

2009-06-05 Thread jorgesmbox-ml
Hi, The matplotlib.collections.Collection documentation reads: "All properties in a collection must be sequences or scalars; if scalars, they will be converted to sequences. The property of the ith element of the collection is: prop[i % len(props)]". I had a look at the docstring documentation

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-14 Thread John Hunter
On Wed, Jan 14, 2009 at 10:24 AM, Hajas, Wayne wrote: > Thanks to everybody who responded to my original post. > > I think Massimo put it best: IDLE does not play well with matplotlib. I > will just have to learn how to be effective with ipython. This may be true that idle doesn't play well with

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-14 Thread Hajas, Wayne
...@dfo-mpo.gc.ca (250)756-7367 -Original Message- From: Mauro Cavalcanti [mailto:mauro...@gmail.com] Sent: Tuesday, January 13, 2009 4:43 PM To: Richard Johns Cc: Hajas, Wayne; matplotlib-users@lists.sourceforge.net Subject: Re: [Matplotlib-users] Newbie question/closing a figure-window

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-14 Thread Mauro Cavalcanti
Dear Richard, 2009/1/14 Richard Johns : > The full edition of Python(x,y) 2.1.9 contains all of the software you > mentioned(PIL, matplotlib, IPython, Enthought Tool Suite) while any of > these missing from the basic and light editions can be added as plugins. Enthought Python includes a lot more

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Richard Johns
On Tue, 2009-01-13 at 22:43 -0200, Mauro Cavalcanti wrote: > Gentlemen, > > I would recommend, in turn, Enthought Python > (http://www.enthought.com), which also includes IPyhton, Matplotlib > and many other useful libraries (eg. PIL) not included in Python(x,y). > > Hope this helps. > > Best re

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Mauro Cavalcanti
Gentlemen, I would recommend, in turn, Enthought Python (http://www.enthought.com), which also includes IPyhton, Matplotlib and many other useful libraries (eg. PIL) not included in Python(x,y). Hope this helps. Best regards, 2009/1/13 Richard Johns : > I have had similar experiences with IDLE

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Mauro Cavalcanti
Gentlemen, I would recommend, in turn, Enthought Python (http://www.enthought.com), which also includes IPyhton, Matplotlib and many other useful libraries (eg. PIL) not included in Python(x,y). Hope this helps. Best regards, 2009/1/13 Richard Johns : > I have had similar experiences with IDLE

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Richard Johns
I have had similar experiences with IDLE on both XP and Ubuntu 8.04 and as a result I use IPython as much as possible. On XP I would recommend that you install Python(x,y), 2.1.9, http://www.pythonxy.com/foreword.php which includes IPython(0.9.1) and IDLE(1.2.2) as well as many other useful progra

Re: [Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Mauro Cavalcanti
Dear Wayne, 2009/1/13 Hajas, Wayne : > > Should I expect IDLE to work with matplotlib? Should I try and figure out > Ipython instead? > Definetely, IPython *is* the environment to work with Python plus Matplotlib, as it already includes built-in support for interactive use of MPL (and in general

[Matplotlib-users] Newbie question/closing a figure-window

2009-01-13 Thread Hajas, Wayne
I'm just getting into matplotlib and python. My apologies if I just haven't found the obvious documentation. I am running XP/Enthought Python 2.5/Idle/matplotlib 0.98.5.2 I run one of the scripts from the tutorial: import numpy as np import matplotlib.pyplot as plt mu

Re: [Matplotlib-users] Newbie question - rotated XY chart

2008-09-24 Thread greg7201
That does the trick. I assumed that swaping the plot parameters would cause other problems, but it doesn't. That was simple! Thanks! Starting with the obvious -- x and y are arbitrary, so instead of plot (x, y) you can plot(y, x) If you need the data to be descending (smaller values o

Re: [Matplotlib-users] Newbie question - rotated XY chart

2008-09-24 Thread John Hunter
On Wed, Sep 24, 2008 at 8:04 PM, greg7201 <[EMAIL PROTECTED]> wrote: > > I am such a matplotlib newbie... but it looks very cool. > > I need to create a basic graph, EXCEPT the x axis needs to go down the page, > and the y axis is across the bottom. (The chart is to display drilling > information

[Matplotlib-users] Newbie question - rotated XY chart

2008-09-24 Thread greg7201
I am such a matplotlib newbie... but it looks very cool. I need to create a basic graph, EXCEPT the x axis needs to go down the page, and the y axis is across the bottom. (The chart is to display drilling information and the norm for drilling engineers is to display depth - the x axis - down the

Re: [Matplotlib-users] newbie question about interactive plotting

2008-03-05 Thread David Fox
Thanks, the -n flag to idle did the trick. -Original Message- From: Darren Dale [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 05, 2008 7:13 AM To: matplotlib-users@lists.sourceforge.net Cc: David Fox Subject: Re: [Matplotlib-users] newbie question about interactive plotting On

Re: [Matplotlib-users] newbie question about interactive plotting

2008-03-05 Thread Darren Dale
On Tuesday 04 March 2008 10:44:13 pm David Fox wrote: > I'm trying to use the pylab interface of matplotlib interactively. I'd > like to enter some commands interactively to generate some data, plot a > graph based on the data, inspect the graph, enter more interactive > python, plot another graph

Re: [Matplotlib-users] newbie question about interactive plotting

2008-03-05 Thread linzhenhua
Hello,David Just a hint.I use ipython and meet the similiar problem as you when I configure the ipython configuration file to use pylab or import pylab from the ipython command line. The problem can be solve for me if I start ipython with the pylab ,that is I use the following c

[Matplotlib-users] newbie question about interactive plotting

2008-03-04 Thread David Fox
I'm trying to use the pylab interface of matplotlib interactively. I'd like to enter some commands interactively to generate some data, plot a graph based on the data, inspect the graph, enter more interactive python, plot another graph, and so on. Instead, what happens is either (a) If I start

Re: [Matplotlib-users] [Newbie question] Is 0:3:100 possible?

2007-09-04 Thread Christopher Barker
Robert Dailey wrote: > Ah; Thanks guys. I thought 'arange' was a class, however it is a > function. I get it now. Sorry for the confusion! Just a note: most often (at least if you are working with floating point values) you want "linspace", rather than arange: >>> N.linspace(3, 99, 33) array([

Re: [Matplotlib-users] [Newbie question] Is 0:3:100 possible?

2007-09-04 Thread Robert Dailey
Ah; Thanks guys. I thought 'arange' was a class, however it is a function. I get it now. Sorry for the confusion! On 9/4/07, Steve Lianoglou <[EMAIL PROTECTED]> wrote: > > On Sep 4, 2007, at 3:09 PM, Robert Dailey wrote: > > > Hi, > > > > I come from using Matlab and I was just curious if it was p

Re: [Matplotlib-users] [Newbie question] Is 0:3:100 possible?

2007-09-04 Thread Matthieu Brucher
Hi, numpy.arange(0, 100, 3) perhaps ? Matthieu 2007/9/4, Robert Dailey <[EMAIL PROTECTED]>: > > Hi, > > I come from using Matlab and I was just curious if it was possible to > create an arange from a quick for loop of numbers? For example: > > 0:3:100 would generate: > 0, 3, 6, 9, 12, , 96,

[Matplotlib-users] [Newbie question] Is 0:3:100 possible?

2007-09-04 Thread Robert Dailey
Hi, I come from using Matlab and I was just curious if it was possible to create an arange from a quick for loop of numbers? For example: 0:3:100 would generate: 0, 3, 6, 9, 12, , 96, 99 And I would want this range to be in an arange() object. Is there a similar way of doing this? Thanks. --

[Matplotlib-users] Newbie question plotting x y data

2006-06-15 Thread Hanno Klemm
I have a very silly question: I have data in the format x y data(x,y) and now I would like to plot a point with a color corresponding to data at position x,y (pretty much like with imshow). Unfortunately, the data does not always fill a rectangular grid, so that using imshow just as it is, does