Use Combinations of Wrappers 

Plotting the distance of planets from Earth over time involves distances with units, time series, and associations for keeping track of the data. All of these objects can be combined and then directly plotted to get a beautiful plot in a straightforward way.

Create a function that gives the distance of a planet from Earth on a given date.

In[1]:=
Click for copyable input
X

Generate a time series of the distance of a planet from Earth over the year 2014. The distances are in astronomical units.

In[2]:=
Click for copyable input
X
In[3]:=
Click for copyable input
X
Out[3]=
In[4]:=
Click for copyable input
X
Out[4]=

Store the distances for several planets in an association.

In[5]:=
Click for copyable input
X
Out[5]=

Plot the distances using an automatically created legend to identify them.

In[6]:=
Click for copyable input
X
Out[6]=