當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。