Plot trajectories

Some of these declarations should be in an unnamed namespace.