[Matplotlib-users] dead link at http://matplotlib.sourceforge.net/fonts.html

2006-06-01 Thread keith.briggs
http://matplotlib.sourceforge.net/fonts.html:
> See font_properties_demo.py 
>  

*click*

An error has been encountered in accessing this page. 

1. Server: matplotlib.sourceforge.net
2. URL path: /examples/font_properties_demo.py
3. Error notes: File does not exist: 
/home/groups/m/ma/matplotlib/htdocs/examples/font_properties_demo.py
4. Error type: 404
5. Request method: GET
6. Request query string: 
7. Time: 2006-06-01 04:50:44 PDT (1149162644)






---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] First impression from a new user

2006-06-01 Thread Marquardt, Colin
Title: First impression from a new user






[Repost, sorry if you get this twice.]

Hi guys,

in my quest for a better gnuplot replacement, I came across matplotlib
yesterday.

I really like it, big thanks to the developers.

It was pretty easy to port over a gnuplot command file.  There are
two things that could have been easier still though:

* My data file consists of a date (in ISO format) and integers. Parsing
  the date was a bit of work. I understand that python's datetime doesn't
  provide any parsing of dates - but maybe matplotlib should have some
  functions for that then?  FWIW, here is how gnuplot does this (adapted
  from http://t16web.lanl.gov/Kawano/gnuplot/datetime-e.html):

 set xdata time
 set timefmt "%Y-%m-%d"
 set format x "%Y-%m"

  In my matplotlib script, I'm now doing:

 mydate = [int(elem) for elem in vals_line[0].split('-')]
 datenums.append(date2num(datetime.date(mydate[0], mydate[1], mydate[2])))
 [...]
 plotline = plot_date(datenums, data)

* gnuplot has a plot style "steps"
  (http://t16web.lanl.gov/Kawano/gnuplot/intro/style-e.html) - I
  could only fake that with with extra "dummy" points in matplotlib
  as I understand it. It would be nice if matplotlib could do this
  for me.

Cheers,
  Colin






Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread Jonathan Taylor
You can use python's time module to parse dates, see time.strptime and 
time.strftime.


Jonathan

Marquardt, Colin wrote:


[Repost, sorry if you get this twice.]

Hi guys,

in my quest for a better gnuplot replacement, I came across matplotlib
yesterday.

I really like it, big thanks to the developers.

It was pretty easy to port over a gnuplot command file.  There are
two things that could have been easier still though:

* My data file consists of a date (in ISO format) and integers. Parsing
  the date was a bit of work. I understand that python's datetime doesn't
  provide any parsing of dates - but maybe matplotlib should have some
  functions for that then?  FWIW, here is how gnuplot does this (adapted
  from http://t16web.lanl.gov/Kawano/gnuplot/datetime-e.html):

 set xdata time
 set timefmt "%Y-%m-%d"
 set format x "%Y-%m"

  In my matplotlib script, I'm now doing:

 mydate = [int(elem) for elem in vals_line[0].split('-')]
 datenums.append(date2num(datetime.date(mydate[0], mydate[1], 
mydate[2])))

 [...]
 plotline = plot_date(datenums, data)

* gnuplot has a plot style "steps"
  (http://t16web.lanl.gov/Kawano/gnuplot/intro/style-e.html) - I
  could only fake that with with extra "dummy" points in matplotlib
  as I understand it. It would be nice if matplotlib could do this
  for me.

Cheers,
  Colin



--

I'm part of the Team in Training: please support our efforts for the
Leukemia and Lymphoma Society!

http://www.active.com/donate/tntsvmb/tntsvmbJTaylor

GO TEAM !!!


Jonathan Taylor   Tel:   650.723.9230
Dept. of Statistics   Fax:   650.725.8977
Sequoia Hall, 137 www-stat.stanford.edu/~jtaylo
390 Serra Mall
Stanford, CA 94305



---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread Bill Dandreta

Here's a code snippet I found somewhere that demonstrates the use:

def make_datetime(s, fmt='%Y-%m-%d %H:%M'):
'''convert string to datetime'''
ts = time.mktime(time.strptime(s, fmt))
return datetime.fromtimestamp(ts)

Warning, this is very slow, if you need to do a lot of conversions it 
will take some time.


Bill

Jonathan Taylor wrote:

You can use python's time module to parse dates, see time.strptime and 
time.strftime.


Jonathan

Marquardt, Colin wrote:


[Repost, sorry if you get this twice.]

Hi guys,

in my quest for a better gnuplot replacement, I came across matplotlib
yesterday.

I really like it, big thanks to the developers.

It was pretty easy to port over a gnuplot command file.  There are
two things that could have been easier still though:

* My data file consists of a date (in ISO format) and integers. Parsing
  the date was a bit of work. I understand that python's datetime 
doesn't

  provide any parsing of dates - but maybe matplotlib should have some
  functions for that then?  FWIW, here is how gnuplot does this (adapted
  from http://t16web.lanl.gov/Kawano/gnuplot/datetime-e.html):

 set xdata time
 set timefmt "%Y-%m-%d"
 set format x "%Y-%m"

  In my matplotlib script, I'm now doing:

 mydate = [int(elem) for elem in vals_line[0].split('-')]
 datenums.append(date2num(datetime.date(mydate[0], mydate[1], 
mydate[2])))

 [...]
 plotline = plot_date(datenums, data)

* gnuplot has a plot style "steps"
  (http://t16web.lanl.gov/Kawano/gnuplot/intro/style-e.html) - I
  could only fake that with with extra "dummy" points in matplotlib
  as I understand it. It would be nice if matplotlib could do this
  for me.

Cheers,
  Colin







---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread John Hunter
> "Marquardt," == Marquardt, Colin <[EMAIL PROTECTED]> writes:


Colin> * My data file consists of a date (in ISO format) and
Colin> integers. Parsing the date was a bit of work. I
Colin> understand that python's datetime doesn't provide any
Colin> parsing of dates - but maybe matplotlib should have
Colin> some functions for that then?  FWIW, here is how
Colin> gnuplot does this (adapted from
Colin> http://t16web.lanl.gov/Kawano/gnuplot/datetime-e.html):

Colin>  set xdata time set timefmt "%Y-%m-%d" set format
Colin> x "%Y-%m"

gnuplot does handle file plots nicely -- here is an example of how to
parse files with date entries and plot them in matplotlib.  Basically,
the load function takes a dictionary mapping column index to a
converter function which returns a float.

from pylab import figure, show, datestr2num, load
dates, closes = load(
'data/msft.csv', delimiter=',',
converters={0:datestr2num}, skiprows=1, usecols=(0,2),
unpack=True)

fig = figure()
ax = fig.add_subplot(111)
ax.plot_date(dates, closes)
show()


The function datestr2num takes any date string recognized by
dateutils.parse (most of them) and returns a floating point number
days since -00-00 which is how matplotlib represents dates.

Colin> * gnuplot has a plot style "steps"
Colin> (http://t16web.lanl.gov/Kawano/gnuplot/intro/style-e.html)
Colin> - I could only fake that with with extra "dummy"
Colin> points in matplotlib as I understand it. It would be
Colin> nice if matplotlib could do this for me.

We have steps too!

  plot(x, y, linestyle='steps')


Hope this helps,
JDH


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread Marquardt, Colin
Title: Re: [Matplotlib-users] First impression from a new user






Bill Dandreta <[EMAIL PROTECTED]> writes:

> Here's a code snippet I found somewhere that demonstrates the use:

Thanks Jonathan and Bill, that works fine.

Cheers,
  Colin






Re: [Matplotlib-users] Problem: Multiple plots with same variables plot incorrectly.

2006-06-01 Thread Christopher Barker

Louis,

This is standard num* array behavior: arrays are mutable, and MPL is not 
making copies of them when you plot, which is a good thing.


by the way, slices of arrays are references too, which is different than 
python lists, so it can be surprising, but also useful



 # 1st Plot .
   x[0]= 1.0
   y[0]= 1.0
   x[1]=-1.0
   y[1]=-1.0
   a.plot(x,y)

   # 2nd Plot .


now you need copies. You can make brand new ones, or use the copy() method:
x = x.copy()
y = y.copy()

you could also pass a copy into the plot method:

a.plot(x.copy(), y.copy())

which is perhaps the behavior you were expecting.

-Chris


--
Christopher Barker, Ph.D.
Oceanographer

NOAA/OR&R/HAZMAT (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115   (206) 526-6317   main reception

[EMAIL PROTECTED]


---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] Problem: Multiple plots with same variables plot incorrectly.

2006-06-01 Thread Louis Pecora

Christopher Barker wrote:

Louis,

This is standard num* array behavior: arrays are mutable, and MPL is 
not making copies of them when you plot, which is a good thing.


by the way, slices of arrays are references too, which is different 
than python lists, so it can be surprising, but also useful



 # 1st Plot .
   x[0]= 1.0
   y[0]= 1.0
   x[1]=-1.0
   y[1]=-1.0
   a.plot(x,y)

   # 2nd Plot .


now you need copies. You can make brand new ones, or use the copy() 
method:

x = x.copy()
y = y.copy()

you could also pass a copy into the plot method:

a.plot(x.copy(), y.copy())

which is perhaps the behavior you were expecting.

-Chris


Thanks, Chris.  I sort of figured this out, but you put it clearer and I 
like the copy suggestion.  I'll use it.  It sure drove me nuts for a 
while.  :-)


--
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC  20375
USA
Ph:  +202-767-6002
email:  [EMAIL PROTECTED]



---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread Marquardt, Colin
Title: Re: [Matplotlib-users] First impression from a new user






John Hunter <[EMAIL PROTECTED]> writes:

> The function datestr2num takes any date string recognized by
> dateutils.parse (most of them) and returns a floating point number
> days since -00-00 which is how matplotlib represents dates.

Wow, matplotlib is even cooler than I thought :)

Let me report some small issues I found (not meant as a rant):

http://matplotlib.sourceforge.net/matplotlib.dates.html refers
to https://moin.conectiva.com.br/DateUtil but this page now resides
at http://labix.org/python-dateutil.

Also, you are using some parameters (usecols, unpack) to load() that
http://matplotlib.sourceforge.net/matplotlib.pylab.html#-load doesn't
know about.

The links for "matplotlib._pylab_helpers", "matplotlib.backends and
"matplotlib" in the "Modules" section of
http://matplotlib.sourceforge.net/matplotlib.pylab.html don't work.

> We have steps too!
>
>   plot(x, y, linestyle='steps')

Oh, I must have overlooked that. I need to remember that
users_guide_0.87.1.pdf doesn't cover everything...

Thanks,
  Colin






Re: [Matplotlib-users] First impression from a new user

2006-06-01 Thread John Hunter
> "Marquardt," == Marquardt, Colin <[EMAIL PROTECTED]> writes:


Colin> Also, you are using some parameters (usecols, unpack) to
Colin> load() that
Colin> http://matplotlib.sourceforge.net/matplotlib.pylab.html#-load
Colin> doesn't know about.


The web page is a bit out of date and needs updating -- thanks for the
pointers to the stale and broken links.  The "load" parameters used
here were recently introduced.  I suggest keeping an ipython shell
open when working with matplotlib, so you have ready access to the
online help 

In [1]: help load

load(fname, comments='%', delimiter=None, converters=None,
 skiprows=0, usecols=None, unpack=False):

Load ASCII data from fname into an array and return the array.

The data must be regular, same number of values in every row

fname can be a filename or a file handle.  Support for gzipped
files is automatic, if the filename ends in .gz

matfile data is not currently supported, but see
Nigel Wade's matfile ftp://ion.le.ac.uk/matfile/matfile.tar.gz

Example usage:

  X = load('test.dat')  # data in two columns
  t = X[:,0]
  y = X[:,1]

Alternatively, you can do the same with "unpack"; see below

  X = load('test.dat')# a matrix of data
  x = load('test.dat')# a single column of data

comments - the character used to indicate the start of a comment
in the file

delimiter is a string-like character used to seperate values in the
file. If delimiter is unspecified or None, any whitespace string is
a separator.

converters, if not None, is a dictionary mapping column number to
a function that will convert that column to a float.  Eg, if
column 0 is a date string: converters={0:datestr2num}

skiprows is the number of rows from the top to skip

usecols, if not None, is a sequence of integer column indexes to
extract where 0 is the first column, eg usecols=(1,4,5) to extract
just the 2nd, 5th and 6th columns

unpack, if True, will transpose the matrix allowing you to unpack
into named arguments on the left hand side

t,y = load('test.dat', unpack=True) # for  two column data
x,y,z = load('somefile.dat', usecols=(3,5,7), unpack=True)

See examples/load_demo.py which exeercises many of these options.



---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=107521&bid=248729&dat=121642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


[Matplotlib-users] 3d bar plots

2006-06-01 Thread Jonathan Taylor


Hi,

Was wondering if anyone knows if there was any way to reproduce this kind of
example:

http://www.mps.mpg.de/dislin/exa_bars3d.html

i.e. a 3d barplot.

Thanks,

Jonathan
begin:vcard
fn:Jonathan  Taylor
n:Taylor;Jonathan 
org:Stanford University;Statistics
adr:;;390 Serra Mall;Stanford;CA;94305;U.S.A.
email;internet:[EMAIL PROTECTED]
title:Assistant Professor
tel;work:650-723-9230
tel;fax:650-725-8977
x-mozilla-html:TRUE
url:http://www-stat.stanford.edu/~jtaylo
version:2.1
end:vcard



RE: [Matplotlib-users] 3d bar plots

2006-06-01 Thread Bowen, Brian M
There is a package called PyQwt3D/Qwt3D that can be used.

Brian 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of
Jonathan Taylor
Sent: Thursday, June 01, 2006 1:38 PM
To: matplotlib-users
Subject: [Matplotlib-users] 3d bar plots


Hi,

Was wondering if anyone knows if there was any way to reproduce this
kind of
example:

http://www.mps.mpg.de/dislin/exa_bars3d.html

i.e. a 3d barplot.

Thanks,

Jonathan



---
All the advantages of Linux Managed Hosting--Without the Cost and Risk!
Fully trained technicians. The highest number of Red Hat certifications in
the hosting industry. Fanatical Support. Click to learn more
http://sel.as-us.falkag.net/sel?cmd=lnk&kid7521&bid$8729&dat1642
___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3d bar plots

2006-06-01 Thread John Hunter
> "Jonathan" == Jonathan Taylor <[EMAIL PROTECTED]> writes:

Jonathan> Hi,

Jonathan> Was wondering if anyone knows if there was any way to
Jonathan> reproduce this kind of example:

Jonathan> http://www.mps.mpg.de/dislin/exa_bars3d.html

Jonathan> i.e. a 3d barplot.

Definitely not with matplotlib currently.  Personally, I don't like
these plots.  One way to represent this data is with three calls to
scatter, each with a different color, and use marker size for the
z-axis.

JDH


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3d bar plots

2006-06-01 Thread Jonathan Taylor
Thanks for all the replies -- I'm not such a huge fan, either, but a 
collaborator of mine is

-- Jonathan

John Hunter wrote:

>>"Jonathan" == Jonathan Taylor <[EMAIL PROTECTED]> writes:
>>
>>
>
>Jonathan> Hi,
>
>Jonathan> Was wondering if anyone knows if there was any way to
>Jonathan> reproduce this kind of example:
>
>Jonathan> http://www.mps.mpg.de/dislin/exa_bars3d.html
>
>Jonathan> i.e. a 3d barplot.
>
>Definitely not with matplotlib currently.  Personally, I don't like
>these plots.  One way to represent this data is with three calls to
>scatter, each with a different color, and use marker size for the
>z-axis.
>
>JDH
>
>
>___
>Matplotlib-users mailing list
>Matplotlib-users@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/matplotlib-users
>  
>

-- 

I'm part of the Team in Training: please support our efforts for the
Leukemia and Lymphoma Society!

http://www.active.com/donate/tntsvmb/tntsvmbJTaylor

GO TEAM !!!


Jonathan Taylor   Tel:   650.723.9230
Dept. of Statistics   Fax:   650.725.8977
Sequoia Hall, 137 www-stat.stanford.edu/~jtaylo
390 Serra Mall
Stanford, CA 94305



___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users


Re: [Matplotlib-users] 3d bar plots

2006-06-01 Thread John Hunter
> "Jonathan" == Jonathan Taylor <[EMAIL PROTECTED]> writes:

Jonathan> Thanks for all the replies -- I'm not such a huge fan,
Jonathan> either, but a collaborator of mine is

Ahh collaborators, can't live with 'em, can't dissuade them from excel
chart junk.

JDH


___
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users