• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python primitive.GraphicPrimitive_xydata类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中sage.plot.primitive.GraphicPrimitive_xydata的典型用法代码示例。如果您正苦于以下问题:Python GraphicPrimitive_xydata类的具体用法?Python GraphicPrimitive_xydata怎么用?Python GraphicPrimitive_xydata使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: __init__

    def __init__(self, xdata, ydata, options):
        """
        Initializes base class Polygon.

        EXAMPLES::

            sage: P = polygon([(0,0), (1,1), (-1,3)], thickness=2)
            sage: P[0].xdata
            [0.0, 1.0, -1.0]
            sage: P[0].options()['thickness']
            2
        """
        self.xdata = xdata
        self.ydata = ydata
        GraphicPrimitive_xydata.__init__(self, options)
开发者ID:CETHop,项目名称:sage,代码行数:15,代码来源:polygon.py


示例2: __init__

    def __init__(self, xdata, ydata, options):
        """
        Initializes base class Point.

        EXAMPLES::

            sage: P = point((3,4))
            sage: P[0].xdata
            [3.0]
            sage: P[0].options()['alpha']
            1
        """
        self.xdata = xdata
        self.ydata = ydata
        GraphicPrimitive_xydata.__init__(self, options)
开发者ID:bukzor,项目名称:sage,代码行数:15,代码来源:point.py


示例3: _plot3d_options

    def _plot3d_options(self, options=None):
        """
        Translate 2D plot options into 3D plot options.

        EXAMPLES::

            sage: L = line([(1,1), (1,2), (2,2), (2,1)], alpha=.5, thickness=10, zorder=2)
            sage: l=L[0]; l
            Line defined by 4 points
            sage: m=l.plot3d(z=2)
            sage: m.texture.opacity
            0.500000000000000
            sage: m.thickness
            10
            sage: L = line([(1,1), (1,2), (2,2), (2,1)], linestyle=":")
            sage: L.plot3d()
            Traceback (most recent call last):
            NotImplementedError: Invalid 3d line style: ':'
        """
        if options is None:
            options = dict(self.options())
        options_3d = {}
        if 'thickness' in options:
            options_3d['thickness'] = options['thickness']
            del options['thickness']
        if 'zorder' in options:
            del options['zorder']
        if 'linestyle' in options:
            if options['linestyle'] not in ('-', 'solid'):
                raise NotImplementedError("Invalid 3d line style: '%s'"%
                                          (options['linestyle']))
            del options['linestyle']
        options_3d.update(GraphicPrimitive_xydata._plot3d_options(self, options))
        return options_3d
开发者ID:bukzor,项目名称:sage,代码行数:34,代码来源:line.py


示例4: _plot3d_options

    def _plot3d_options(self, options=None):
        """
        Updates ``BezierPath`` options to those allowed by 3D implementation.

        EXAMPLES::

            sage: from sage.plot.bezier_path import BezierPath
            sage: B = BezierPath([[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],{'linestyle':'dashed'})
            sage: B._plot3d_options()
            Traceback (most recent call last):
            ...
            NotImplementedError: Invalid 3d line style: dashed
            sage: B = BezierPath([[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],{'fill':False, 'thickness':2})
            sage: B._plot3d_options()
            {'thickness': 2}
        """
        if options == None:
            options = dict(self.options())
        options_3d = {}
        if 'thickness' in options:
            options_3d['thickness'] = options['thickness']
            del options['thickness']
        if 'fill' in options:
            if options['fill']:
                raise NotImplementedError, "Invalid 3d fill style.  Must set fill to False."
            del options['fill']
        if 'linestyle' in options:
            if options['linestyle'] != 'solid':
                raise NotImplementedError, "Invalid 3d line style: %s" % options['linestyle']
            del options['linestyle']
        options_3d.update(GraphicPrimitive_xydata._plot3d_options(self, options))
        return options_3d
开发者ID:sageb0t,项目名称:testsage,代码行数:32,代码来源:bezier_path.py


示例5: _plot3d_options

    def _plot3d_options(self, options=None):
        """
        Translate 2D plot options into 3D plot options.

        EXAMPLES::

            sage: A=point((1,1),size=22)
            sage: a=A[0];a
            Point set defined by 1 point(s)
            sage: b=a.plot3d()
            sage: b.size
            22
            sage: b=a.plot3d(size=3)
            sage: b.size
            3
        """
        if options is None:
            options = dict(self.options())
        options_3d = {}
        if 'size' in options:
            options_3d['size'] = options['size']
            del options['size']
        if options.pop('faceted', False):
            raise NotImplementedError("3D points can not be faceted.")
        for o in ('marker', 'markeredgecolor'): # remove 2D options
            if o in options:
                del options[o]

        options_3d.update(GraphicPrimitive_xydata._plot3d_options(self, options))
        return options_3d
开发者ID:bukzor,项目名称:sage,代码行数:30,代码来源:point.py


示例6: _plot3d_options

    def _plot3d_options(self, options=None):
        """
        Translate 2D plot options into 3D plot options.

        EXAMPLES::

            sage: A=point((1,1),size=22)
            sage: a=A[0];a
            Point set defined by 1 point(s)
            sage: b=a.plot3d()
            sage: b.size
            22
            sage: b=a.plot3d(size=3)
            sage: b.size
            3
        """
        if options == None:
            options = dict(self.options())
        options_3d = {}
        if 'size' in options:
            options_3d['size'] = options['size']
            del options['size']
        if 'faceted' in options:
            if options['faceted']:
                raise NotImplementedError, "No 3d faceted points."
            del options['faceted']
        options_3d.update(GraphicPrimitive_xydata._plot3d_options(self, options))
        return options_3d
开发者ID:CETHop,项目名称:sage,代码行数:28,代码来源:point.py


示例7: __init__

    def __init__(self, xdata, ydata, options):
        """
        Initialize a line graphics primitive.

        EXAMPLES::

            sage: from sage.plot.line import Line
            sage: Line([-1,2], [17,4], {'thickness':2})
            Line defined by 2 points
        """
        valid_options = self._allowed_options().keys()
        for opt in options.iterkeys():
            if opt not in valid_options:
                raise RuntimeError("Error in line(): option '%s' not valid."%opt)
        self.xdata = xdata
        self.ydata = ydata
        GraphicPrimitive_xydata.__init__(self, options)
开发者ID:bukzor,项目名称:sage,代码行数:17,代码来源:line.py


示例8: __init__

    def __init__(self, path, options):
        """
        Returns a graphics primitive of a path of Bezier curves.

        EXAMPLES::

            sage: from sage.plot.bezier_path import BezierPath
            sage: BezierPath([[(0,0),(.5,.5),(1,0)],[(.5,1),(0,0)]],{'linestyle':'dashed'})
            Bezier path from (0, 0) to (0, 0)
        """
        import numpy as np
        self.path = path
        codes = [1] + (len(self.path[0])-1)*[len(self.path[0])]
        vertices = self.path[0]
        for curve in self.path[1:]:
            vertices += curve
            codes += (len(curve))*[len(curve)+1]
        self.codes = codes
        self.vertices = np.array(vertices, np.float)
        GraphicPrimitive_xydata.__init__(self, options)
开发者ID:sageb0t,项目名称:testsage,代码行数:20,代码来源:bezier_path.py


示例9: _plot3d_options

    def _plot3d_options(self, options=None):
        """
        Translate 2d plot options into 3d plot options.

        EXAMPLES::

            sage: P = polygon([(1,1), (1,2), (2,2), (2,1)], alpha=.5)
            sage: p=P[0]; p
            Polygon defined by 4 points
            sage: q=p.plot3d()
            sage: q.texture.opacity
            0.500000000000000
        """
        if options is None:
            options = dict(self.options())
        for o in ['thickness', 'zorder', 'legend_label', 'fill']:
            options.pop(o, None)
        return GraphicPrimitive_xydata._plot3d_options(self, options)
开发者ID:CETHop,项目名称:sage,代码行数:18,代码来源:polygon.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python buffer.OutputBuffer类代码示例发布时间:2022-05-27
下一篇:
Python primitive.GraphicPrimitive类代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap