Re: Simple but puzzling plotting question
- To: mathgroup at smc.vnet.net
- Subject: [mg78614] Re: Simple but puzzling plotting question
- From: Jean-Marc Gulliet <jeanmarc.gulliet at gmail.com>
- Date: Thu, 5 Jul 2007 04:09:11 -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? If you want the data correctly aligned on the right hand side and no annoying zeros on the left, one can use an index (or rescale an existing index: that all depends on the actual data structure you are using) as in the following example: data1 = {54.8, 54.6, 54.78, 56.19, 56.97, 57.16, 57.7, 57.72, 56.28, 56.78, 56.63, 55.77, 54.92, 55.6, 54.86, 53.6, 53.54, 53.49, 53.39, 51.59, 53.2, 55.09}; data2 = {89.89, 89.01, 89.39, 88.89, 88.18, 87.41, 86.84, 87.07, 87.06, 88.05, 88.22, 88.55, 88.13, 88.2, 88.89}; data1 = Table[{i, data1[[i]]}, {i, Length[data1]}]; data2 = Table[{i + Length[data1] - Length[data2], data2[[i]]}, {i, Length[data2]}]; << "Graphics`MultipleListPlot`" MultipleListPlot[{data1, data2}] Regards, Jean-Marc