'This is the function which interprets
arguments given to Plot.__init__ and
Plot.__setattr__. Returns an initialized
instance of the appropriate child class.'

def __new__(cls, *args, **kwargs):

    (newargs, newkwargs) = PlotMode._extract_options(args, kwargs)
    mode_arg = newkwargs.get('mode', '')
    (d_vars, intervals) = PlotMode._interpret_args(newargs)
    i_vars = PlotMode._find_i_vars(d_vars, intervals)
    (i, d) = (max([len(i_vars), len(intervals)]), len(d_vars))
    subcls = PlotMode._get_mode(mode_arg, i, d)
    o = object.__new__(subcls)
    o.d_vars = d_vars
    o._fill_i_vars(i_vars)
    o._fill_intervals(intervals)
    o.options = newkwargs
    return o
