Move matplotlib imports in trackobjects to within-method