code: def _plot_prepare(self, components, units):
          
  
          # components to plot
          if components is None:
              components = self.pos.components
          n_comps = len(components)
  
          # if units not specified, get units from the components
          if units is not None:
              if isinstance(units, u.UnitBase):
                  units = [units]*n_comps # global unit
  
              elif len(units) != n_comps:
                  raise ValueError('You must specify a unit for each axis, or a '
                                   'single unit for all axes.')
  
          labels = []
          x = []
          for i,name in enumerate(components):
              val = getattr(self, name)
  
              if units is not None:
                  val = val.to(units[i])
                  unit = units[i]
              else:
                  unit = val.unit
  
              if val.unit != u.one:
                  uu = unit.to_string(format='latex_inline')
                  unit_str = ' [{}]'.format(uu)
              else:
                  unit_str = ''
  
              # Figure out how to fancy display the component name
              if name.startswith('d_'):
                  dot = True
                  name = name[2:]
              else:
                  dot = False
  
              if name in _greek_letters:
                  name = r"\{}".format(name)
  
              if dot:
                  name = "\dot{{{}}}".format(name)
  
              labels.append('${}$'.format(name) + unit_str)
              x.append(val.value)
  
          return x, labels
docs: Prepare the ``PhaseSpacePosition`` or subclass for passing to a plotting
          routine to plot all projections of the object.