iregular data set

Made a boo boo, the image is not showing so here it is again

image001.gif

image002.gif

···

-----Original Message-----
From: matplotlib-users-bounces@lists.sourceforge.net
[mailto:matplotlib-users-bounces@lists.sourceforge.net] On Behalf Of
Bill Dandreta
Sent: Friday, July 21, 2006 3:09 PM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] iregular data set

Rodrigues, Joseph wrote:

I have a question (new user here): I have datasets of irregular time
spaced data and am having a problem with Matplot lib.

I am plotting two datasets: one is continuous time series data (simple
line chart) and the other irregular time series data.

The problem I have is: MatPlotLib is interpolating data for the
irregular data where there is no data.

So if I have data from 1985 - 1989 then no data for 1990 - 1994,
matplotlib is drawing a line connecting the missing data.

How does one plot irregular spaced time series data?

The way I do that is index the time data and plot against the index.

1985--0
1986--1
.
.
.
1989--4
1995--5
etc.

Bill

------------------------------------------------------------------------
-
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share
your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
_______________________________________________
Matplotlib-users mailing list
Matplotlib-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-users

Rodrigues, Joseph wrote:

Made a boo boo, the image is not showing so here it is again

From: matplotlib-users-bounces@lists.sourceforge.net
[mailto:matplotlib-users-bounces@lists.sourceforge.net] On Behalf Of
Bill Dandreta
Sent: Friday, July 21, 2006 3:09 PM
To: matplotlib-users@lists.sourceforge.net
Subject: Re: [Matplotlib-users] iregular data set

Rodrigues, Joseph wrote:
  

I have a question (new user here): I have datasets of irregular time
spaced data and am having a problem with Matplot lib.

I am plotting two datasets: one is continuous time series data (simple
line chart) and the other irregular time series data.

The problem I have is: MatPlotLib is interpolating data for the
irregular data where there is no data.

So if I have data from 1985 - 1989 then no data for 1990 - 1994,
matplotlib is drawing a line connecting the missing data.

How does one plot irregular spaced time series data?

From what I see matplotlib is just connecting points. Just because your x values have what you think are gaps, matplotlib doesn't know that. I assume your two calls to plot use the x and y values for each plot. Matplotlib will connect points that are sequential no matter what the x values are. There may be ways to assign the y values as NANs for those "missing" x values.

···

-----Original Message-----

--
Cheers,

Lou Pecora

Code 6362
Naval Research Lab
Washington, DC 20375
USA
Ph: +202-767-6002
email: pecora@...1125...