# How can temporal data with multiple paths be shown in one plot?

I am trying to plot SunPosition for an entire year. The examples I have seen plot a single day or one exact time across the entire year, not the full data set. (NOTE: the example code has a three day date range so as speed the trial calculations)

The data is generated with the code below:

loc = GeoPosition[{45, 0}]

tz = 0

sunriseToSunset[loc_, date_] :=
SunPosition[loc,
DateRange[Sunrise[loc, date], Sunset[loc, date], {10, "Minute"}]]

dr = DateRange[DateObject[{2015, 1, 1}, TimeZone -> tz],
DateObject[{2015, 1, 3}, TimeZone -> tz]];

{dt, foo} =
AbsoluteTiming@
TemporalData@
ParallelMap[sunriseToSunset[loc, #] &, dr, Method -> Automatic];


The output foo is TemporalData with three paths. Each point in the list is {date, {azimuth, altitude}}

I would like to plot altitude vs azimuth for all three days (Paths) on the same chart at the same time.

Subsequently I would want to append the list with data calculated from the foo. For instance, attach Cos[altitude] to each point so the temporal data becomes {date, {azimuth, altitude, Cos[altitude]}}

• Greetings! To make the most of Mma.SE please take the tour now. Help us to help you, write an excellent question. Edit if improvable, show due diligence, give brief context, include minimum working examples of code and data in formatted form. As you receive give back, vote and answer questions, keep the site useful, be kind, correct mistakes and share what you have learned. – rhermans Oct 14 '15 at 19:45
• Have you considered the display problem? I can not see how you can make a single plot with 365 paths containing an average of 120 points each without producing a visual nightmare. Perhaps you might break it up into 12 monthly plots? – m_goldberg Oct 15 '15 at 2:19

The plots are easy. First, as an opaque "object", TemporalData has a "Properties" method, e.g.

foo["Properties"]
(* {"Components", "DateList", "DatePath", "DatePaths", "Dates",
"FirstDates", "FirstTimes", "FirstValues", "LastDates", "LastTimes",
"LastValues", "Part", "Path", "PathCount", "PathFunction",
"PathFunctions", "PathLength", "PathLengths", "Paths", "PathTimes",
"SliceData", "SliceDistribution", "TimeList", "Times",
"ValueDimensions", "ValueList", "Values"} *)


At first look, "Values" would be the correct property to use, but it only returns data from one path, so "Paths" is the correct one with the ordinates extracted using Part which can be supplied to ListPlot, e.g.

ListPlot@foo["Paths"][[All, All, 2]]

• Your code solution did not work for me. With modification from ListPlot@foo["Path"][[All, All, 2]] to ListPlot@foo["Paths"][[All, All, 2]] the plotting works as I wanted. Thank you. – MBO Oct 28 '15 at 19:14
• @MBO so it was an obvious typo. They happen. – rcollyer Oct 28 '15 at 19:28