sukiari
(Andrew Robertson)
1
I want to plot (just for fun) Gold and Silver on a date list plot. My code looks like this:
DateListPlot[{FinancialData[“GLD”, “Jan 1,2006”]}, {FinancialData[“SLV”, “Jan 1,2006”]}, Joined → True, PlotLegends → {“Gold”, “Silver”}]
While Mathematica doesn’t throw any errors, it also doesn’t plot (or label) silver! My resulting plot looks like this:
Could anybody clue me in to what my error is?
mayest
(Tim Mayes)
2
You have some braces that you don’t need. This will work:
DateListPlot[{FinancialData["GLD", "Jan 1,2006"],
FinancialData["SLV", "Jan 1,2006"]}, Joined -> True,
PlotLegends -> {"Gold", "Silver"}]
Use the braces to hold all of the series that you want to plot, not each individual one.
Tim