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?
Rating: 0%, 0 votes
data1 = {{{2006, 10, 1}, 10}, {{2006, 10, 15}, 12}, {{2006, 10, 30},
15}, {{2006, 11, 20}, 20}};
data2 = {{{2006, 10, 5}, 15}, {{2006, 10, 20}, 8}, {{2006, 11, 10},
5}, {{2006, 11, 15}, 1}};
DateListPlot[{data1, data2}, Joined -
The same sort of thing works for ListPlot, too.
Bobby
--
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
You can do this only if each of the data sets use the same x-coordinate.
l1 = Table[{x, Sin[Pi x]}, {x, -Pi, Pi, Pi/8}];
l2 = Table[{x, Cos[Pi x]}, {x, -Pi, 0, Pi/12}];
l3 = Table[{x, Tan[Pi x]}, {x, 0, Pi, Pi/16}];
ListPlot[{l1, l2, l3}, Joined -
In your case, you'd want to plot each of your currencies as they vary with
date.
Regards,
Dave.
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
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
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
First generate two data sets of differing length:
set1 = Sort@Table[RandomReal[], {5}];
set2 = Sort@Table[RandomReal[], {10}];
then plot them:
ListPlot[{set1, set2}, Joined -
Or if you are using version 5.x, you can get a similar result with:
set1 = Sort@Table[Random[], {5}];
set2 = Sort@Table[Random[], {10}];
Show[
Block[{$DisplayFunction=Identity},
{ListPlot[set1, PlotJoined- ListPlot[set2, PlotJoined- PlotRange- --
To reply via email subtract one hundred and four
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
the missing data to get lists of equal length. (Note that
*MultipleListPlot* will plot lists of different length but the smaller
list will be padded on the right. See below.) For instance,
In[1]:=
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};
Length /@ {data1, data2}
Out[3]=
{22, 15}
In[4]:=
<< "Graphics`MultipleListPlot`"
MultipleListPlot[{data1, data2}]
data3 = PadLeft[data2, Length[data1]];
MultipleListPlot[{data1, data3}]
Regards,
Jean-Marc
Was this solution helpful? Show your Appreciation by rating it:
Rating: 0%, 0 votes
various sizes, as you can see in the following example.(A demo notebook
and a PDF file are available at
#
#
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 -
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
Was this solution helpful? Show your Appreciation by rating it:

