Prev: Retrieving orphaned code
Next: ArrayPlot with inverted ColorFunction depending on MaxPlotPoints
From: Thomas Melehan on 11 Apr 2010 04:31 Does anyone know if there any undocumented PlotLegend type functions that work in a DateListPlot? Using ShowLegend is too much work.
From: Darren Glosemeyer on 12 Apr 2010 22:58 Thomas Melehan wrote: > Does anyone know if there any undocumented PlotLegend type functions that work in a DateListPlot? Using ShowLegend is too much work. > In current released versions, PlotLegend will work with DateListPlot if the date coordinates are AbsoluteTimes. The package code did not know how to handle data with DateList and DateString coordinates, but this is fixed in the version of Mathematica currently under development. For now, converting date coordinates to AbsoluteTimes will provide a workaround. Here is an example of how this can be done. << PlotLegends` data = FinancialData["AAPL", {2008, 11, 1}]; (* convert date coordinates to absolute times *) newdata = data; newdata[[All, 1]] = Map[AbsoluteTime, newdata[[All, 1]]]; (* plot the new data with a legend *) DateListPlot[newdata, PlotLegend -> {"AAPL"}] (* add legend options as desired *) DateListPlot[newdata, PlotLegend -> {"AAPL"}, LegendPosition -> {-1.1, -1}] Darren Glosemeyer Wolfram Research
|
Pages: 1 Prev: Retrieving orphaned code Next: ArrayPlot with inverted ColorFunction depending on MaxPlotPoints |