当前位置: 首页>>代码示例>>Python>>正文


Python Canvas.cartesian方法代码示例

本文整理汇总了Python中toyplot.canvas.Canvas.cartesian方法的典型用法代码示例。如果您正苦于以下问题:Python Canvas.cartesian方法的具体用法?Python Canvas.cartesian怎么用?Python Canvas.cartesian使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在toyplot.canvas.Canvas的用法示例。


在下文中一共展示了Canvas.cartesian方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: scatterplot

# 需要导入模块: from toyplot.canvas import Canvas [as 别名]
# 或者: from toyplot.canvas.Canvas import cartesian [as 别名]
def scatterplot(
        a,
        b=None,
        along="x",
        color=None,
        marker="o",
        area=None,
        size=None,
        opacity=1.0,
        title=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 scatter plot in a single call.

    See :meth:`toyplot.coordinates.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.coordinates.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)
    axes = canvas.cartesian(
        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.scatterplot(
        a=a,
        b=b,
        along=along,
        color=color,
        marker=marker,
        area=area,
        size=size,
        opacity=opacity,
        title=title,
        style=style,
        mstyle=mstyle,
        mlstyle=mlstyle,
        filename=filename)
    return canvas, axes, mark
开发者ID:,项目名称:,代码行数:79,代码来源:

示例2: fill

# 需要导入模块: from toyplot.canvas import Canvas [as 别名]
# 或者: from toyplot.canvas.Canvas import cartesian [as 别名]
def fill(
        a,
        b=None,
        c=None,
        along="x",
        baseline=None,
        color=None,
        opacity=1.0,
        title=None,
        style=None,
        filename=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 fill plot in a single call.

    See :meth:`toyplot.coordinates.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.coordinates.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)
    axes = canvas.cartesian(
        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,
        color=color,
        opacity=opacity,
        title=title,
        style=style,
        filename=filename)
    return canvas, axes, mark
开发者ID:,项目名称:,代码行数:71,代码来源:

示例3: graph

# 需要导入模块: from toyplot.canvas import Canvas [as 别名]
# 或者: from toyplot.canvas.Canvas import cartesian [as 别名]
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.coordinates.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.coordinates.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.cartesian(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
开发者ID:,项目名称:,代码行数:69,代码来源:


注:本文中的toyplot.canvas.Canvas.cartesian方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。