Example #1
0
def scatterplot(a, b=None, along="x", color=None, colormap=None, palette=None, marker="o", size=20, fill=None, fill_colormap=None, fill_palette=None, opacity=1.0, title=None, style=None, mstyle=None, mlstyle=None, xmin=None, xmax=None, ymin=None, ymax=None, show=True, xshow=True, yshow=True, label=None, xlabel=None, ylabel=None, xscale="linear", yscale="linear", padding=10, width=None, height=None, canvas_style=None):
  """Convenience function for creating a scatter plot in a single call.

  See :meth:`toyplot.axes.Cartesian.scatterplot`, :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for parameter descriptions.

  Returns
  -------
  canvas: :class:`toyplot.canvas.Canvas`
    A new canvas object.
  axes: :class:`toyplot.axes.Cartesian`
    A new set of 2D axes that fill the canvas.
  mark: :class:`toyplot.mark.Plot`
    The new scatter plot mark.
  """
  canvas = Canvas(width=width, height=height, style=canvas_style)
  axes = canvas.axes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, show=show, xshow=xshow, yshow=yshow, label=label, xlabel=xlabel, ylabel=ylabel, xscale=xscale, yscale=yscale, padding=padding)
  mark = axes.scatterplot(a=a, b=b, along=along, color=color, colormap=colormap, palette=palette, marker=marker, size=size, fill=fill, fill_colormap=fill_colormap, fill_palette=fill_palette, opacity=opacity, title=title, style=style, mstyle=mstyle, mlstyle=mlstyle)
  return canvas, axes, mark
Example #2
0
def fill(a, b=None, c=None, along="x", baseline=None, fill=None, colormap=None, palette=None, opacity=1.0, title=None, style=None, xmin=None, xmax=None, ymin=None, ymax=None, show=True, xshow=True, yshow=True, label=None, xlabel=None, ylabel=None, xscale="linear", yscale="linear", padding=10, width=None, height=None, canvas_style=None):
  """Convenience function for creating a fill plot in a single call.

  See :meth:`toyplot.axes.Cartesian.fill`, :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for parameter descriptions.

  Returns
  -------
  canvas: :class:`toyplot.canvas.Canvas`
    A new canvas object.
  axes: :class:`toyplot.axes.Cartesian`
    A new set of 2D axes that fill the canvas.
  mark: :class:`toyplot.mark.FillBoundaries` or :class:`toyplot.mark.FillMagnitudes`
    The new bar mark.
  """
  canvas = Canvas(width=width, height=height, style=canvas_style)
  axes = canvas.axes(xmin=xmin, xmax=xmax, ymin=ymin, ymax=ymax, show=show, xshow=xshow, yshow=yshow, label=label, xlabel=xlabel, ylabel=ylabel, xscale=xscale, yscale=yscale, padding=padding)
  mark = axes.fill(a=a, b=b, c=c, along=along, baseline=baseline, fill=fill, colormap=colormap, palette=palette, opacity=opacity, title=title, style=style)
  return canvas, axes, mark
Example #3
0
def fill(a,
         b=None,
         c=None,
         along="x",
         baseline=None,
         fill=None,
         colormap=None,
         palette=None,
         opacity=1.0,
         title=None,
         style=None,
         xmin=None,
         xmax=None,
         ymin=None,
         ymax=None,
         show=True,
         xshow=True,
         yshow=True,
         label=None,
         xlabel=None,
         ylabel=None,
         xscale="linear",
         yscale="linear",
         padding=10,
         width=None,
         height=None,
         canvas_style=None):
    """Convenience function for creating a fill plot in a single call.

  See :meth:`toyplot.axes.Cartesian.fill`, :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for parameter descriptions.

  Returns
  -------
  canvas: :class:`toyplot.canvas.Canvas`
    A new canvas object.
  axes: :class:`toyplot.axes.Cartesian`
    A new set of 2D axes that fill the canvas.
  mark: :class:`toyplot.mark.FillBoundaries` or :class:`toyplot.mark.FillMagnitudes`
    The new bar mark.
  """
    canvas = Canvas(width=width, height=height, style=canvas_style)
    axes = canvas.axes(xmin=xmin,
                       xmax=xmax,
                       ymin=ymin,
                       ymax=ymax,
                       show=show,
                       xshow=xshow,
                       yshow=yshow,
                       label=label,
                       xlabel=xlabel,
                       ylabel=ylabel,
                       xscale=xscale,
                       yscale=yscale,
                       padding=padding)
    mark = axes.fill(a=a,
                     b=b,
                     c=c,
                     along=along,
                     baseline=baseline,
                     fill=fill,
                     colormap=colormap,
                     palette=palette,
                     opacity=opacity,
                     title=title,
                     style=style)
    return canvas, axes, mark
Example #4
0
def scatterplot(a,
                b=None,
                along="x",
                color=None,
                colormap=None,
                palette=None,
                marker="o",
                size=20,
                fill=None,
                fill_colormap=None,
                fill_palette=None,
                opacity=1.0,
                title=None,
                style=None,
                mstyle=None,
                mlstyle=None,
                xmin=None,
                xmax=None,
                ymin=None,
                ymax=None,
                show=True,
                xshow=True,
                yshow=True,
                label=None,
                xlabel=None,
                ylabel=None,
                xscale="linear",
                yscale="linear",
                padding=10,
                width=None,
                height=None,
                canvas_style=None):
    """Convenience function for creating a scatter plot in a single call.

  See :meth:`toyplot.axes.Cartesian.scatterplot`, :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for parameter descriptions.

  Returns
  -------
  canvas: :class:`toyplot.canvas.Canvas`
    A new canvas object.
  axes: :class:`toyplot.axes.Cartesian`
    A new set of 2D axes that fill the canvas.
  mark: :class:`toyplot.mark.Plot`
    The new scatter plot mark.
  """
    canvas = Canvas(width=width, height=height, style=canvas_style)
    axes = canvas.axes(xmin=xmin,
                       xmax=xmax,
                       ymin=ymin,
                       ymax=ymax,
                       show=show,
                       xshow=xshow,
                       yshow=yshow,
                       label=label,
                       xlabel=xlabel,
                       ylabel=ylabel,
                       xscale=xscale,
                       yscale=yscale,
                       padding=padding)
    mark = axes.scatterplot(a=a,
                            b=b,
                            along=along,
                            color=color,
                            colormap=colormap,
                            palette=palette,
                            marker=marker,
                            size=size,
                            fill=fill,
                            fill_colormap=fill_colormap,
                            fill_palette=fill_palette,
                            opacity=opacity,
                            title=title,
                            style=style,
                            mstyle=mstyle,
                            mlstyle=mlstyle)
    return canvas, axes, mark
Example #5
0
def plot(
    a,
    b=None,
    along="x",
    color=None,
    stroke_width=2.0,
    opacity=1.0,
    title=None,
    marker=None,
    area=None,
    size=None,
    mfill=None,
    mopacity=1.0,
    mtitle=None,
    style=None,
    mstyle=None,
    mlstyle=None,
    filename=None,
    aspect=None,
    xmin=None,
    xmax=None,
    ymin=None,
    ymax=None,
    show=True,
    xshow=True,
    yshow=True,
    label=None,
    xlabel=None,
    ylabel=None,
    xscale="linear",
    yscale="linear",
    padding=10,
    width=None,
    height=None,
):
    """Convenience function for creating a line plot in a single call.

    See :meth:`toyplot.axes.Cartesian.plot`,
    :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for
    parameter descriptions.

    Returns
    -------
    canvas: :class:`toyplot.canvas.Canvas`
      A new canvas object.
    axes: :class:`toyplot.axes.Cartesian`
      A new set of 2D axes that fill the canvas.
    mark: :class:`toyplot.mark.Plot`
      The new plot mark.
    """
    canvas = Canvas(width=width, height=height)
    axes = canvas.axes(
        aspect=aspect,
        xmin=xmin,
        xmax=xmax,
        ymin=ymin,
        ymax=ymax,
        show=show,
        xshow=xshow,
        yshow=yshow,
        label=label,
        xlabel=xlabel,
        ylabel=ylabel,
        xscale=xscale,
        yscale=yscale,
        padding=padding,
    )
    mark = axes.plot(
        a=a,
        b=b,
        along=along,
        color=color,
        stroke_width=stroke_width,
        opacity=opacity,
        title=title,
        marker=marker,
        area=area,
        size=size,
        mfill=mfill,
        mopacity=mopacity,
        mtitle=mtitle,
        style=style,
        mstyle=mstyle,
        mlstyle=mlstyle,
        filename=filename,
    )
    return canvas, axes, mark
Example #6
0
def graph(
    a,
    b=None,
    c=None,
    olayout=None,
    layout=None,
    along="x",
    vlabel=None,
    vcoordinates=None,
    vcolor=None,
    vmarker="o",
    varea=None,
    vsize=None,
    vopacity=1.0,
    vtitle=None,
    vstyle=None,
    vlstyle=None,
    vlshow=True,
    ecolor=None,
    ewidth=1.0,
    eopacity=1.0,
    estyle=None,
    padding=20,
    width=None,
    height=None,
):  # pragma: no cover
    """Convenience function for creating a graph plot in a single call.

    See :meth:`toyplot.axes.Cartesian.graph`,
    :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for
    parameter descriptions.

    Returns
    -------
    canvas: :class:`toyplot.canvas.Canvas`
        A new canvas object.
    axes: :class:`toyplot.axes.Cartesian`
        A new set of 2D axes that fill the canvas.
    mark: :class:`toyplot.mark.Graph`
        The new graph mark.
    """
    canvas = Canvas(width=width, height=height)
    axes = canvas.axes(aspect="fit-range", show=False, padding=padding)
    mark = axes.graph(
        a=a,
        b=b,
        c=c,
        olayout=olayout,
        layout=layout,
        along=along,
        vlabel=vlabel,
        vcoordinates=vcoordinates,
        vcolor=vcolor,
        vmarker=vmarker,
        varea=varea,
        vsize=vsize,
        vopacity=vopacity,
        vtitle=vtitle,
        vstyle=vstyle,
        vlstyle=vlstyle,
        vlshow=vlshow,
        ecolor=ecolor,
        ewidth=ewidth,
        eopacity=eopacity,
        estyle=estyle,
    )
    return canvas, axes, mark
Example #7
0
def plot(
    a,
    b=None,
    along="x",
    color=None,
    stroke_width=2.0,
    opacity=1.0,
    title=None,
    marker=None,
    area=None,
    size=None,
    mfill=None,
    mopacity=1.0,
    mtitle=None,
    style=None,
    mstyle=None,
    mlstyle=None,
    filename=None,
    aspect=None,
    xmin=None,
    xmax=None,
    ymin=None,
    ymax=None,
    show=True,
    xshow=True,
    yshow=True,
    label=None,
    xlabel=None,
    ylabel=None,
    xscale="linear",
    yscale="linear",
    padding=10,
    width=None,
    height=None,
):
    """Convenience function for creating a line plot in a single call.

    See :meth:`toyplot.axes.Cartesian.plot`,
    :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for
    parameter descriptions.

    Returns
    -------
    canvas: :class:`toyplot.canvas.Canvas`
      A new canvas object.
    axes: :class:`toyplot.axes.Cartesian`
      A new set of 2D axes that fill the canvas.
    mark: :class:`toyplot.mark.Plot`
      The new plot mark.
    """
    canvas = Canvas(width=width, height=height)
    axes = canvas.axes(aspect=aspect,
                       xmin=xmin,
                       xmax=xmax,
                       ymin=ymin,
                       ymax=ymax,
                       show=show,
                       xshow=xshow,
                       yshow=yshow,
                       label=label,
                       xlabel=xlabel,
                       ylabel=ylabel,
                       xscale=xscale,
                       yscale=yscale,
                       padding=padding)
    mark = axes.plot(a=a,
                     b=b,
                     along=along,
                     color=color,
                     stroke_width=stroke_width,
                     opacity=opacity,
                     title=title,
                     marker=marker,
                     area=area,
                     size=size,
                     mfill=mfill,
                     mopacity=mopacity,
                     mtitle=mtitle,
                     style=style,
                     mstyle=mstyle,
                     mlstyle=mlstyle,
                     filename=filename)
    return canvas, axes, mark
Example #8
0
def graph(
    a,
    b=None,
    c=None,
    olayout=None,
    layout=None,
    along="x",
    vlabel=None,
    vcoordinates=None,
    vcolor=None,
    vmarker="o",
    varea=None,
    vsize=None,
    vopacity=1.0,
    vtitle=None,
    vstyle=None,
    vlstyle=None,
    vlshow=True,
    ecolor=None,
    ewidth=1.0,
    eopacity=1.0,
    estyle=None,
    padding=20,
    width=None,
    height=None,
):  # pragma: no cover
    """Convenience function for creating a graph plot in a single call.

    See :meth:`toyplot.axes.Cartesian.graph`,
    :meth:`toyplot.canvas.Canvas.axes`, and :class:`toyplot.canvas.Canvas` for
    parameter descriptions.

    Returns
    -------
    canvas: :class:`toyplot.canvas.Canvas`
        A new canvas object.
    axes: :class:`toyplot.axes.Cartesian`
        A new set of 2D axes that fill the canvas.
    mark: :class:`toyplot.mark.Graph`
        The new graph mark.
    """
    canvas = Canvas(width=width, height=height)
    axes = canvas.axes(aspect="fit-range", show=False, padding=padding)
    mark = axes.graph(
        a=a,
        b=b,
        c=c,
        olayout=olayout,
        layout=layout,
        along=along,
        vlabel=vlabel,
        vcoordinates=vcoordinates,
        vcolor=vcolor,
        vmarker=vmarker,
        varea=varea,
        vsize=vsize,
        vopacity=vopacity,
        vtitle=vtitle,
        vstyle=vstyle,
        vlstyle=vlstyle,
        vlshow=vlshow,
        ecolor=ecolor,
        ewidth=ewidth,
        eopacity=eopacity,
        estyle=estyle,
    )
    return canvas, axes, mark