MathGroup Archive 2007

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Simple but puzzling plotting question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg78601] Re: Simple but puzzling plotting question
  • From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
  • Date: Thu, 5 Jul 2007 04:02:26 -0400 (EDT)
  • Organization: The Open University, Milton Keynes, UK
  • References: <f6fr2l$8s1$1@smc.vnet.net>

ouadad wrote:
> I simply want to plot three currency daily exchange rates, USD, GBP and EURO, from April 1, 1990 to March 31, 2006.  The problem is the EURO.  Since it only came into existence on 01 January 1999, I don't have data going as far back as 1990.  Therefore, for the Euro column, all entries for the period April 1, 1990 to December 31, 1998 are blank.  Unfortunately, this causes a partw error in Mathematica.  Does anyone know how to plot different sized datasets on the same graph?

In version 6.0, *DateListPlot* manages very well to plot lists of 
various sizes, as you can see in the following example.(A demo notebook 
and a PDF file are available at
http://homepages.nyu.edu/~jmg336/mathematica/DateListPlotExample.nb
http://homepages.nyu.edu/~jmg336/mathematica/DateListPlotExample.pdf
respectively.)

In[1]:= ms = FinancialData["MS", {"March 1, 2005", "March 31, 2005"}]
ibm = FinancialData["IBM", {"March 10, 2005", "March 31, 2005"}]
Length /@ {ms, ibm}
DateListPlot[{ms, ibm}, Joined -> True, Filling -> Bottom]

Out[1]= {{{2005, 3, 1}, 54.8}, {{2005, 3, 2}, 54.6}, {{2005, 3, 3},
   54.78}, {{2005, 3, 4}, 56.19}, {{2005, 3, 7}, 56.97}, {{2005, 3, 8},
    57.16}, {{2005, 3, 9}, 57.7}, {{2005, 3, 10},
   57.72}, {{2005, 3, 11}, 56.28}, {{2005, 3, 14},
   56.78}, {{2005, 3, 15}, 56.63}, {{2005, 3, 16},
   55.77}, {{2005, 3, 17}, 54.92}, {{2005, 3, 18},
   55.6}, {{2005, 3, 21}, 54.86}, {{2005, 3, 22},
   53.6}, {{2005, 3, 23}, 53.54}, {{2005, 3, 24},
   53.49}, {{2005, 3, 28}, 53.39}, {{2005, 3, 29},
   51.59}, {{2005, 3, 30}, 53.2}, {{2005, 3, 31}, 55.09}}

Out[2]= {{{2005, 3, 10}, 89.89}, {{2005, 3, 11},
   89.01}, {{2005, 3, 14}, 89.39}, {{2005, 3, 15},
   88.89}, {{2005, 3, 16}, 88.18}, {{2005, 3, 17},
   87.41}, {{2005, 3, 18}, 86.84}, {{2005, 3, 21},
   87.07}, {{2005, 3, 22}, 87.06}, {{2005, 3, 23},
   88.05}, {{2005, 3, 24}, 88.22}, {{2005, 3, 28},
   88.55}, {{2005, 3, 29}, 88.13}, {{2005, 3, 30},
   88.2}, {{2005, 3, 31}, 88.89}}

Out[3]= {22, 15}

Out[4]= [... plot deleted ...]

Regards,
Jean-Marc


  • Prev by Date: Re: Working with factors of triangular numbers.
  • Next by Date: Re: Is there a way to make ListConvolve to use a adaptive kernel?
  • Previous by thread: Re: Simple but puzzling plotting question
  • Next by thread: Re: new behavior of Plot