Re: [Matplotlib-users] plot_date() - Correct format to plot

2008-09-04 Thread stuartornum

Thanks,

Worked perfectly.



Mathieu Leplatre-2 wrote:
> 
> On Wed, Aug 27, 2008 at 11:14 AM, stuartornum <[EMAIL PROTECTED]>
> wrote:
>>
>> Hi,
>>
>> I would like to be able to plot dates along the X axis' with values up
>> the
>> Y. However Im having problems with the correct format in order to pass to
>> plot_date().
>>
>> This is what I have so far: (example)
>>
>> 
>> List = [ [datetime.datetime(2008, 7, 12, 5, 12)], ['46.8'] ]
>>
>> plot_date(List[0], List[1])
>> #
>> Returns error:
>>
>> c = numeric.array(data, dtype=tc, copy=True, order=order)
>> ValueError: setting an array element with a sequence.
>> #
>>
>> I have looked at the pylab example for plot_date, however it uses a
>> drange()
>> to figure out the dates and doesn't show me how to do it one by one.
>>
> 
> Hi
> 
> Have a look at pylab.date2num()
> 
> Mathieu.
> 
> 
> 
>> Thank you for your time.
>> --
>> View this message in context:
>> http://www.nabble.com/plot_date%28%29---Correct-format-to-plot-tp19181899p19181899.html
>> Sent from the matplotlib - users mailing list archive at Nabble.com.
>>
>>
>> -
>> This SF.Net email is sponsored by the Moblin Your Move Developer's
>> challenge
>> Build the coolest Linux based applications with Moblin SDK & win great
>> prizes
>> Grand prize is a trip for two to an Open Source event anywhere in the
>> world
>> http://moblin-contest.org/redirect.php?banner_id=100&url=/
>> ___
>> Matplotlib-users mailing list
>> Matplotlib-users@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>>
> 
> -
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the
> world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> ___
> Matplotlib-users mailing list
> Matplotlib-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users
> 
> 

-- 
View this message in context: 
http://www.nabble.com/plot_date%28%29---Correct-format-to-plot-tp19181899p19306302.html
Sent from the matplotlib - users mailing list archive at Nabble.com.


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] pylab.boxplot

2008-09-04 Thread Eric Wertman
Hi Everyone.. the docs for boxplot say :

Returns a list of the :class:`matplotlib.lines.Line2D` instances added.

It seems to be returning a list of strings rather than a list of
handles... What's the easiest way for me to get the handles of those
objects, with only the names?  It's giving me this:

medians 
fliers 
whiskers 
boxes 
caps 


Thanks!

Eric

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pylab.boxplot

2008-09-04 Thread Ryan May
Eric Wertman wrote:
> Hi Everyone.. the docs for boxplot say :
> 
> Returns a list of the :class:`matplotlib.lines.Line2D` instances added.
> 
> It seems to be returning a list of strings rather than a list of
> handles... What's the easiest way for me to get the handles of those
> objects, with only the names?  It's giving me this:
> 
> medians 
> fliers 
> whiskers 
> boxes 
> caps 

I get a dictionary with medians, flier, whiskers, boxes, and caps as 
keys and lists of Line2D objects as the values.  What version are you 
running?  I'm on 0.98.3 here.

Either way the docstring is wrong.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] pylab.boxplot

2008-09-04 Thread Eric Wertman
I'm using 0.98.3 as well... I get a dictionary too.  Should have
backed up another step and checked that, I just iterated over the
return and got the keys.  Thanks for the help.


On Thu, Sep 4, 2008 at 2:25 PM, Ryan May <[EMAIL PROTECTED]> wrote:
> Eric Wertman wrote:
>>
>> Hi Everyone.. the docs for boxplot say :
>>
>> Returns a list of the :class:`matplotlib.lines.Line2D` instances added.
>>
>> It seems to be returning a list of strings rather than a list of
>> handles... What's the easiest way for me to get the handles of those
>> objects, with only the names?  It's giving me this:
>>
>> medians 
>> fliers 
>> whiskers 
>> boxes 
>> caps 
>
> I get a dictionary with medians, flier, whiskers, boxes, and caps as keys
> and lists of Line2D objects as the values.  What version are you running?
>  I'm on 0.98.3 here.
>
> Either way the docstring is wrong.
>
> Ryan
>
> --
> Ryan May
> Graduate Research Assistant
> School of Meteorology
> University of Oklahoma
>

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] imshow and projections

2008-09-04 Thread Erik Tollerud
I've been playing with some of the projections in matplotlib,
recently, and have some questions/noticed some odd behavior:

1. Is there any way to activate a projection mode with the pyplot
interface other than the subplot(111,projection='whatever') method a
la /examples/api/custom_projection_example.py ?  Along these same
lines, is the projection feature documented in greater detail
somewhere?  About everything I've figured out has come from
custom_projection_example.py ...

2. I have a skymap I would like to plot using a particular projection
- what I've been doing so far is specifying x and y coordinates using
mgrid and calling contourf(x,y,data,100) to approximate this.  But
what I'd rather do is something like
imshow(data,extent=[-pi,pi,-pi/2,pi/2]) ... when I call that with a
projection axis activated, the projection isn't honored - the image
just appears as a regular square box.  Is there any way to get imshow
to respect the projection?

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] imshow and projections

2008-09-04 Thread Jae-Joon Lee
> 2. I have a skymap I would like to plot using a particular projection
> - what I've been doing so far is specifying x and y coordinates using
> mgrid and calling contourf(x,y,data,100) to approximate this.  But
> what I'd rather do is something like
> imshow(data,extent=[-pi,pi,-pi/2,pi/2]) ... when I call that with a
> projection axis activated, the projection isn't honored - the image
> just appears as a regular square box.  Is there any way to get imshow
> to respect the projection?
>

Did you try pcolormesh (or pcolor)? I believe these commands respect
the projection.

 pcolormesh(x, y, data)

-JJ

-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Hatching not working in matplotlib 0.98

2008-09-04 Thread Crend King






I tried hatch option in pylab.bar() in both matplotlib 0.98.2 and 0.98.3. The 
hatch_demo.py in the example directory only draw four grey bars, no hatch or 
them. However, when I try the same script on matplotlib 0.91.4 (the 
maintainance version), it's working. I wonder if it is a bug introduced 
recently? If so, it's good to have it fixed, right?

BTW: can I set the line width for the hatches?

Thanks!

_
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] OS X Bad Aspect Ratio

2008-09-04 Thread Josh Lawrence
Hey all,

When I plot using python 2.5.2 and matplotlib 0.98.3 (and 0.98.1) I  
have the following problem. If I run a script from the command line  
that plots and saves the figure, I get the default aspect ratio of (8,  
6). If, however, I close the plotting window and replot without  
exiting the python prompt and starting anew, the aspect changes to  
something like (8, 6.04). I can reliably get the (8, 6) aspect ratio  
if I quit the python prompt and load a new prompt. The problem only  
comes after I close the plot window and replot.

The new aspect ratio is consistent after it first changes. That is, if  
I plot, close the window, replot, close the window, and replot again,  
the 2nd and 3rd figures would save with the same aspect ratio while  
the first would have the one I desire. What could be the problem?

Cheers,

Josh


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] masking values in quiver plot

2008-09-04 Thread Eric Firing
Jeff Whitaker wrote:
> Eric Firing wrote:
>> Jeff Whitaker wrote:
>>> Michael Roettger wrote:
 Hi all,

 maybe I've misunderstood something concerning masking or quiver plots:
 I want to exclude some data from a quiver plot. Here's an example:

 8<
 import numpy as N
 import pylab as pl
 import matplotlib.numerix.ma as ma

 # prepare data
 X,Y = pl.meshgrid(range(5),range(5))
 angles = pl.rand(5,5)
 U = N.cos(angles)
 V = N.sin(angles)

 # prepare mask
 M = N.zeros((5,5), dtype='bool')
 M[2,2] = True

 # apply mask
 Um = ma.masked_array(U,mask=M)
 Vm = ma.masked_array(V,mask=M)

 # plot
 pl.quiver(X,Y,Um,Vm)
 # pl.plot(range(5),Um[2],'x')

 pl.show()
 -->8

 Using the commented 'plot' command works as expected, but 'quiver' 
 results in
 empty axes. If I take U,V instead of Um,Vm, the arrows are drawn ..
 What am I doing wrong or is there another way to exclude arrows from 
 being
 plotted?

   Thank you in advance,

 Michael

   
>>>
>>> Michael:  I've fixed this now in svn.  If you don't want to update to 
>>> svn trunk, you can make this simple change in quiver.py
>>
>> Jeff,
>>
>> Thanks for the quick fix--it will help for now, and will work in most 
>> use cases, but it is not actually correct in general.  The problem is 
>> that quiver supports input of changed values of U, V, and C on the 
>> existing X, Y grid, and these changed values can be masked arrays with 
>> different points masked. (See Quiver.set_UVC().) That is why I did not 
>> use delete_masked_points in the first place.  Masked values used to be 
>> handled correctly; I suspect the bug is actually in collections, not 
>> in quiver itself.  I can't track it down right now, but may be able to 
>> look at it over the weekend.
>>
>> Eric
> 
> OK Eric - I figured you'd chime in when you got a chance.  Let's 
> consider it a temporary workaround then.  BTW:  I updated the 
> quiver_demo.py example to test the masking.

Very useful, thank you.  I have removed the workaround and made a more 
consistent repair to the masked array handling.  The problem came in 
when PolyCollection was changed to automatically close the path by default.

Eric

> 
> 
> -Jeff
>>
>>>
>>> --- lib/matplotlib/quiver.py(revision 6046)
>>> +++ lib/matplotlib/quiver.py(working copy)
>>> @@ -334,6 +334,12 @@
>>>  def __init__(self, ax, *args, **kw):
>>>  self.ax = ax
>>>  X, Y, U, V, C = self._parse_args(*args)
>>> +if C is not None:
>>> +X, Y, U, V, C = 
>>> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(),
>>> + V.ravel(),C.ravel())
>>> +else:
>>> +X, Y, U, V = 
>>> delete_masked_points(X.ravel(),Y.ravel(),U.ravel(),
>>> +  V.ravel())
>>>  self.X = X
>>>  self.Y = Y
>>>  self.XY = np.hstack((X[:,np.newaxis], Y[:,np.newaxis]))
>>>
>>>
>>> -Jeff
>>>
>>
> 
> 


-
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users