function h = plotContourLines(in, varargin)

    if isa(in, 'matlab.graphics.chart.primitive.Contour')
        contourLines = contour2lines(in);
    elseif ismatrix(in) & size(in,1)==2
        contourLines = contour2lines(in);
    elseif isstruct(in)
        contourLines = in;
    else
        error('The input is not a valid data type. Must be a Contour handle or a Contour matrix of size (2,n).');
    end


    for l = 1:numel(contourLines)
        h(l) = plot(contourLines(l).x, contourLines(l).y, varargin{:}, 'DisplayName', num2str(contourLines(l).level));
        hold on;
    end
end