[Matplotlib-users] date-gaps in timeseries

2007-06-10 Thread rolandreichel

Hi,

I want to plot some timeseries (eg. stockcharts). I use now  
DateLocator/Formatter, it works fine for me with the exeption, that  
dataless periods on X-Axis (eg. weekends) are also plotted. Is there an  
easy way to suppress them?

regards

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Setting linestyle of contours with negative values problem

2007-06-10 Thread Mark Bakker

Hello -

I tried to turn of the feature that makes contours with negative values
dashed.
According to the mailinglist this should go by setting: rcParams['
contour.negative_linestyle']=('None','None')
I tried any combination of the None, None syntax, or just 'solid', but
nothing worked.
Example shown below. I am using 0.90.1.
Thanks, Mark

from pylab import *
x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
rcParams['contour.negative_linestyle']=('None','None')
contour(x,y,x,colors='b')

Error message:

Traceback (most recent call last):
 File "", line 1, in ?
   contour(x,y,x,colors='b')
 File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1777, in
contour
   draw_if_interactive()
 File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 59, in draw_if_interactive
   figManager.show()
 File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 311, in show
   self.canvas.draw()
 File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py",
line 154, in draw
   FigureCanvasAgg.draw(self)
 File "C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py",
line 392, in draw
   self.figure.draw(renderer)
 File "C:\Python24\Lib\site-packages\matplotlib\figure.py", line 601, in
draw
   for a in self.axes: a.draw(renderer)
 File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1286, in
draw
   a.draw(renderer)
 File "C:\Python24\Lib\site-packages\matplotlib\collections.py", line 700,
in draw
   transoffset)
ValueError: invalid literal for float(): None
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] [SPANISH] Python, OGR and Matplotlib

2007-06-10 Thread Jose Gomez-Dans
Hi all,
First, sorry for the crossposting. I have drafted a small document (it
is in Spanish, if there's interest, I'll have a go at translating it)
on how to use OGR from Python access geospatial data, which can be
further analysed or plotted with matplotlib. It is a very brief
introduction, and surely there is much to improve, but I was looking
for something like this for a while, and couldn't find it.

The page is here: 

Cheers,
jose

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Setting linestyle of contours with negative values problem

2007-06-10 Thread Eric Firing
Mark,

  As a quick workaround, try

rcParams['contour.negative_linestyle']=(6, 0)

This is a hack--using dashes with zero-length spaces.

I expect to have a better solution in svn shortly.

Eric


Mark Bakker wrote:
> Hello -
> 
> I tried to turn of the feature that makes contours with negative values 
> dashed.
> According to the mailinglist this should go by setting: 
> rcParams['contour.negative_linestyle']=('None','None')
> I tried any combination of the None, None syntax, or just 'solid', but 
> nothing worked.
> Example shown below. I am using 0.90.1.
> Thanks, Mark
> 
> from pylab import *
> x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
> rcParams['contour.negative_linestyle']=('None','None')
> contour(x,y,x,colors='b')
> 
> Error message:
> 
> Traceback (most recent call last):
>   File "", line 1, in ?
> contour(x,y,x,colors='b')
>   File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1777, 
> in contour
> draw_if_interactive()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 59, in draw_if_interactive
> figManager.show()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 311, in show
> self.canvas.draw()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 154, in draw
> FigureCanvasAgg.draw(self)
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py", line 
> 392, in draw
> self.figure.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\figure.py", line 601, 
> in draw
> for a in self.axes: a.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1286, in 
> draw
> a.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\collections.py", line 
> 700, in draw
> transoffset)
> ValueError: invalid literal for float(): None
> 
> 
> 
> 
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] Simple scatter plot over an image

2007-06-10 Thread __

Hello,

I'm trying to plot a simple list of x/y coords over an image (.png). I can
show the image, or plot the data, but cannot find a way to layer one over
the other. I would greatly appreciate someone pointing me in the right
direction. Thanks.
-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Setting linestyle of contours with negative values problem

2007-06-10 Thread Eric Firing
Mark,

Presumably the mailing list method worked at one time, but it would be 
obscure and unintuitive even if it worked now.  There are no other 
explicit dash styles given as a pair of numbers in the rc file, so the 
change I made in svn is to use the strings "solid" and "dashed"; the 
two-float specification is deprecated.

Eric

Mark Bakker wrote:
> Hello -
> 
> I tried to turn of the feature that makes contours with negative values 
> dashed.
> According to the mailinglist this should go by setting: 
> rcParams['contour.negative_linestyle']=('None','None')
> I tried any combination of the None, None syntax, or just 'solid', but 
> nothing worked.
> Example shown below. I am using 0.90.1.
> Thanks, Mark
> 
> from pylab import *
> x,y = meshgrid(linspace(-3,3,10),linspace(-3,3,10))
> rcParams['contour.negative_linestyle']=('None','None')
> contour(x,y,x,colors='b')
> 
> Error message:
> 
> Traceback (most recent call last):
>   File "", line 1, in ?
> contour(x,y,x,colors='b')
>   File "C:\Python24\Lib\site-packages\matplotlib\pylab.py", line 1777, 
> in contour
> draw_if_interactive()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 59, in draw_if_interactive
> figManager.show()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 311, in show
> self.canvas.draw()
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_tkagg.py", 
> line 154, in draw
> FigureCanvasAgg.draw(self)
>   File 
> "C:\Python24\Lib\site-packages\matplotlib\backends\backend_agg.py", line 
> 392, in draw
> self.figure.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\figure.py", line 601, 
> in draw
> for a in self.axes: a.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\axes.py", line 1286, in 
> draw
> a.draw(renderer)
>   File "C:\Python24\Lib\site-packages\matplotlib\collections.py", line 
> 700, in draw
> transoffset)
> ValueError: invalid literal for float(): None
> 
> 
> 
> 
> -
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> 
> 
> 
> 
> ___
> Matplotlib-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/matplotlib-users


-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Simple scatter plot over an image

2007-06-10 Thread Jake Emerson
The python imaging library is pretty good for this kind of thing.
 
http://www.pythonware.com/library/pil/handbook/
 
Here's an (untested) example. Hope it helps.
 
Jake
 
 
#!/usr/bin/env python
 
from pylab import scatter, save
import Image
 
#get the background image, and find out how big it is
im_bg = Image.open("background.png")
bg_width, bg_height = im.size
 
#make a white canvas on which to paste the background image and the
scatter plot
#this will allow you to, say, have the x- and y-axis values fall outside
of the background image's limits
im_canvas = Image.new("RGBA", (bg_width+60, bg_height+60), (255, 255,
255, 0))
 
#create the scatter plot from x and y data with matplotlib
scatter(x, y, s=sizes, alpha=0.75)
 
#save the scatter plot, and then retrieve it for use in PIL, convert to
RGBA so that alpha levels will work
#there is probably a better way to do this with gcf() or gci()...
savefig("scatter_plot.png")
im_scatter = Image.open("scatter_plot.png").convert("RGBA")
 
#resize the scatter image to make it fit nice
im_scatter.resize((bg_width+10, bg_height+10))
 
#bring all of the images together by pasting them onto the white canvas,
use the overlayed image as the mask (third element)
im_canvas.paste(im_bg, (30, 30), im_bg)   #play around
with the paste locations (30, 30)
im_canvas.paste(im_scatter, (10, 30), im_scatter)  #these won't be
perfect the first time (10, 30)
 
#save it
im_canvas.save("combo_image.png")
 
 
 
 


From: __ [mailto:[EMAIL PROTECTED] 
Sent: Sunday, June 10, 2007 5:22 PM
To: [email protected]
Subject: [Matplotlib-users] Simple scatter plot over an image


Hello, 

I'm trying to plot a simple list of x/y coords over an image (.png). I
can show the image, or plot the data, but cannot find a way to layer one
over the other. I would greatly appreciate someone pointing me in the
right direction. Thanks. 

-
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/___
Matplotlib-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/matplotlib-users