(*args, **kwargs)
return plots
Plots a function of a single variable and returns an instance of
    the ``Plot`` class (also, see the description of the
    ``show`` keyword argument below).

    The plotting uses an adaptive algorithm which samples recursively to
    accurately plot the plot. The adaptive algorithm uses a random point near
    the midpoint of two points that has to be further sampled. Hence the same
    plots can appear slightly different.

    Usage
    =====

    Single Plot

    ``plot(expr, range, **kwargs)``

    If the range is not specified, then a default range of (-10, 10) is used.

    Multiple plots with same range.

    ``plot(expr1, expr2, ..., range, **kwargs)``

    If the range is not specified, then a default range of (-10, 10) is used.

    Multiple plots with different ranges.

    ``plot((expr1, range), (expr2, range), ..., **kwargs)``

    Range has to be specified for every expression.

    Default range may change in the future if a more advanced default range
    detection algorithm is implemented.

    Arguments
    =========

    ``expr`` : Expression representing the function of single variable

    ``range``: (x, 0, 5), A 3-tuple denoting the range of the free variable.

    Keyword Arguments
    =================

    Arguments for ``plot`` function:

    ``show``: Boolean. The default value is set to ``True``. Set show to
    ``False`` and the function will not display the plot. The returned
    instance of the ``Plot`` class can then be used to save or display
    the plot by calling the ``save()`` and ``show()`` methods
    respectively.

    Arguments for ``LineOver1DRangeSeries`` class:

    ``adaptive``: Boolean. The default value is set to True. Set adaptive to False and
    specify ``nb_of_points`` if uniform sampling is required.

    ``depth``: int Recursion depth of the adaptive algorithm. A depth of value ``n``
    samples a maximum of `2^{n}` points.

    ``nb_of_points``: int. Used when the ``adaptive`` is set to False. The function
    is uniformly sampled at ``nb_of_points`` number of points.

    Aesthetics options:

    ``line_color``: float. Specifies the color for the plot.
    See ``Plot`` to see how to set color for the plots.

    If there are multiple plots, then the same series series are applied to
    all the plots. If you want to set these options separately, you can index
    the ``Plot`` object returned and set it.

    Arguments for ``Plot`` class:

    ``title`` : str. Title of the plot. It is set to the latex representation of
    the expression, if the plot has only one expression.

    ``xlabel`` : str. Label for the x-axis.

    ``ylabel`` : str. Label for the y-axis.

    ``xscale``: {'linear', 'log'} Sets the scaling of the x-axis.

    ``yscale``: {'linear', 'log'} Sets the scaling if the y-axis.

    ``axis_center``: tuple of two floats denoting the coordinates of the center or
    {'center', 'auto'}

    ``xlim`` : tuple of two floats, denoting the x-axis limits.

    ``ylim`` : tuple of two floats, denoting the y-axis limits.

    Examples
    ========

    >>> from sympy import symbols
    >>> from sympy.plotting import plot
    >>> x = symbols('x')

    Single Plot

    >>> plot(x**2, (x, -5, 5))
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-5.0, 5.0)

    Multiple plots with single range.

    >>> plot(x, x**2, x**3, (x, -5, 5))
    Plot object containing:
    [0]: cartesian line: x for x over (-5.0, 5.0)
    [1]: cartesian line: x**2 for x over (-5.0, 5.0)
    [2]: cartesian line: x**3 for x over (-5.0, 5.0)


    Multiple plots with different ranges.

    >>> plot((x**2, (x, -6, 6)), (x, (x, -5, 5)))
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-6.0, 6.0)
    [1]: cartesian line: x for x over (-5.0, 5.0)

    No adaptive sampling.

    >>> plot(x**2, adaptive=False, nb_of_points=400)
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-10.0, 10.0)

    See Also
    ========

    Plot, LineOver1DRangeSeries.
Plots a function of a single variable and returns an instance of
    the ``Plot`` class (also, see the description of the
    ``show`` keyword argument below).
Plots a function of a single variable and returns an instance of the Plot class ( also see the description of the show keyword argument below ) .
def plot(*args, **kwargs):
    """
    Plots a function of a single variable and returns an instance of
    the ``Plot`` class (also, see the description of the
    ``show`` keyword argument below).

    The plotting uses an adaptive algorithm which samples recursively to
    accurately plot the plot. The adaptive algorithm uses a random point near
    the midpoint of two points that has to be further sampled. Hence the same
    plots can appear slightly different.

    Usage
    =====

    Single Plot

    ``plot(expr, range, **kwargs)``

    If the range is not specified, then a default range of (-10, 10) is used.

    Multiple plots with same range.

    ``plot(expr1, expr2, ..., range, **kwargs)``

    If the range is not specified, then a default range of (-10, 10) is used.

    Multiple plots with different ranges.

    ``plot((expr1, range), (expr2, range), ..., **kwargs)``

    Range has to be specified for every expression.

    Default range may change in the future if a more advanced default range
    detection algorithm is implemented.

    Arguments
    =========

    ``expr`` : Expression representing the function of single variable

    ``range``: (x, 0, 5), A 3-tuple denoting the range of the free variable.

    Keyword Arguments
    =================

    Arguments for ``plot`` function:

    ``show``: Boolean. The default value is set to ``True``. Set show to
    ``False`` and the function will not display the plot. The returned
    instance of the ``Plot`` class can then be used to save or display
    the plot by calling the ``save()`` and ``show()`` methods
    respectively.

    Arguments for ``LineOver1DRangeSeries`` class:

    ``adaptive``: Boolean. The default value is set to True. Set adaptive to False and
    specify ``nb_of_points`` if uniform sampling is required.

    ``depth``: int Recursion depth of the adaptive algorithm. A depth of value ``n``
    samples a maximum of `2^{n}` points.

    ``nb_of_points``: int. Used when the ``adaptive`` is set to False. The function
    is uniformly sampled at ``nb_of_points`` number of points.

    Aesthetics options:

    ``line_color``: float. Specifies the color for the plot.
    See ``Plot`` to see how to set color for the plots.

    If there are multiple plots, then the same series series are applied to
    all the plots. If you want to set these options separately, you can index
    the ``Plot`` object returned and set it.

    Arguments for ``Plot`` class:

    ``title`` : str. Title of the plot. It is set to the latex representation of
    the expression, if the plot has only one expression.

    ``xlabel`` : str. Label for the x-axis.

    ``ylabel`` : str. Label for the y-axis.

    ``xscale``: {'linear', 'log'} Sets the scaling of the x-axis.

    ``yscale``: {'linear', 'log'} Sets the scaling if the y-axis.

    ``axis_center``: tuple of two floats denoting the coordinates of the center or
    {'center', 'auto'}

    ``xlim`` : tuple of two floats, denoting the x-axis limits.

    ``ylim`` : tuple of two floats, denoting the y-axis limits.

    Examples
    ========

    >>> from sympy import symbols
    >>> from sympy.plotting import plot
    >>> x = symbols('x')

    Single Plot

    >>> plot(x**2, (x, -5, 5))
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-5.0, 5.0)

    Multiple plots with single range.

    >>> plot(x, x**2, x**3, (x, -5, 5))
    Plot object containing:
    [0]: cartesian line: x for x over (-5.0, 5.0)
    [1]: cartesian line: x**2 for x over (-5.0, 5.0)
    [2]: cartesian line: x**3 for x over (-5.0, 5.0)


    Multiple plots with different ranges.

    >>> plot((x**2, (x, -6, 6)), (x, (x, -5, 5)))
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-6.0, 6.0)
    [1]: cartesian line: x for x over (-5.0, 5.0)

    No adaptive sampling.

    >>> plot(x**2, adaptive=False, nb_of_points=400)
    Plot object containing:
    [0]: cartesian line: x**2 for x over (-10.0, 10.0)

    See Also
    ========

    Plot, LineOver1DRangeSeries.

    """
    args = list(map(sympify, args))
    free = set()
    for a in args:
        if isinstance(a, Expr):
            free |= a.free_symbols
            if len(free) > 1:
                raise ValueError(
                    'The same variable should be used in all '
                    'univariate expressions being plotted.')
    x = free.pop() if free else Symbol('x')
    kwargs.setdefault('xlabel', x.name)
    kwargs.setdefault('ylabel', 'f(%s)' % x.name)
    show = kwargs.pop('show', True)
    series = []
    plot_expr = check_arguments(args, 1, 1)
    series = [LineOver1DRangeSeries(*arg, **kwargs) for arg in plot_expr]

    plots = Plot(*series, **kwargs)
    if show:
        plots.show()
    return plots
def plot ( * args , * * kwargs ) : args = list ( map ( sympify , args ) ) free = set ( ) for a in args : if isinstance ( a , Expr ) : free |= a . free_symbols if len ( free ) > 1 : raise ValueError ( 'The same variable should be used in all ' 'univariate expressions being plotted.' ) x = free . pop ( ) if free else Symbol ( 'x' ) kwargs . setdefault ( 'xlabel' , x . name ) kwargs . setdefault ( 'ylabel' , 'f(%s)' % x . name ) show = kwargs . pop ( 'show' , True ) series = [ ] plot_expr = check_arguments ( args , 1 , 1 ) series = [ LineOver1DRangeSeries ( * arg , * * kwargs ) for arg in plot_expr ] plots = Plot ( * series , * * kwargs ) if show : plots . show ( ) return plots