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


Python FancyArrowPatch.draw方法代码示例

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


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

示例1: draw

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
 def draw(self, renderer):
     with warnings.catch_warnings():
         warnings.simplefilter("ignore")
         xs3d, ys3d, zs3d = self._verts3d
         xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
         self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
         FancyArrowPatch.draw(self, renderer)
开发者ID:askerry,项目名称:FGE_MISC,代码行数:9,代码来源:vizfuncs.py

示例2: draw

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
 def draw(self, renderer):
     #xs3d, ys3d, zs3d = self._verts3d
     for coords in self._verts3d:
         xs3d, ys3d, zs3d = coords[0], coords[1], coords[2]
         xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
         self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
         FancyArrowPatch.draw(self, renderer)
开发者ID:wgurecky,项目名称:spyTran,代码行数:9,代码来源:ordplot.py

示例3: draw

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
    def draw(self, renderer):
        """

        :param renderer:
        """
        xs3d, ys3d, zs3d = self._verts3d
        xs, ys, zs = proj3d.proj_transform(xs3d, ys3d, zs3d, renderer.M)
        self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
        FancyArrowPatch.draw(self, renderer)
开发者ID:andrewbolster,项目名称:aietes,代码行数:11,代码来源:__init__.py

示例4: draw

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
    def draw(self, renderer, rasterized=True):
        """
        Drawing actually happens here
        """
        # Draws only when the dragging finished
        if self.leftdown:
            return
        xs3d, ys3d, zs3d = self._verts3d
        for i in xrange(len(xs3d)):
            xs, ys, _ = proj3d.proj_transform(xs3d[i], ys3d[i], zs3d[i], renderer.M)
            self.set_positions((xs[0], ys[0]), (xs[1], ys[1]))
            self.set_color(self.colors[i])
            FancyArrowPatch.draw(self, renderer)

        self.leftdown = False
开发者ID:diffpy,项目名称:srfit-sasview,代码行数:17,代码来源:arrow3d.py

示例5: AnnotationBbox

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
class AnnotationBbox(martist.Artist, _AnnotationBase):
    """
    Annotation-like class, but with offsetbox instead of Text.
    """

    zorder = 3

    def __str__(self):
        return "AnnotationBbox(%g,%g)"%(self.xy[0],self.xy[1])
    @docstring.dedent_interpd
    def __init__(self, offsetbox, xy,
                 xybox=None,
                 xycoords='data',
                 boxcoords=None,
                 frameon=True, pad=0.4, # BboxPatch
                 annotation_clip=None,
                 box_alignment=(0.5, 0.5),
                 bboxprops=None,
                 arrowprops=None,
                 fontsize=None,
                 **kwargs):
        """
        *offsetbox* : OffsetBox instance

        *xycoords* : same as Annotation but can be a tuple of two
           strings which are interpreted as x and y coordinates.

        *boxcoords* : similar to textcoords as Annotation but can be a
           tuple of two strings which are interpreted as x and y
           coordinates.

        *box_alignment* : a tuple of two floats for a vertical and
           horizontal alignment of the offset box w.r.t. the *boxcoords*.
           The lower-left corner is (0.0) and upper-right corner is (1.1).

        other parameters are identical to that of Annotation.
        """
        self.offsetbox = offsetbox

        self.arrowprops = arrowprops

        self.set_fontsize(fontsize)


        if arrowprops is not None:
            self._arrow_relpos = self.arrowprops.pop("relpos", (0.5, 0.5))
            self.arrow_patch = FancyArrowPatch((0, 0), (1,1),
                                               **self.arrowprops)
        else:
            self._arrow_relpos = None
            self.arrow_patch = None

        _AnnotationBase.__init__(self,
                                 xy, xytext=xybox,
                                 xycoords=xycoords, textcoords=boxcoords,
                                 annotation_clip=annotation_clip)

        martist.Artist.__init__(self, **kwargs)

        #self._fw, self._fh = 0., 0. # for alignment
        self._box_alignment = box_alignment

        # frame
        self.patch = FancyBboxPatch(
            xy=(0.0, 0.0), width=1., height=1.,
            facecolor='w', edgecolor='k',
            mutation_scale=self.prop.get_size_in_points(),
            snap=True
            )
        self.patch.set_boxstyle("square",pad=pad)
        if bboxprops:
            self.patch.set(**bboxprops)
        self._drawFrame =  frameon


    def contains(self,event):
        t,tinfo = self.offsetbox.contains(event)
        #if self.arrow_patch is not None:
        #    a,ainfo=self.arrow_patch.contains(event)
        #    t = t or a

        # self.arrow_patch is currently not checked as this can be a line - JJ

        return t,tinfo


    def get_children(self):
        children = [self.offsetbox, self.patch]
        if self.arrow_patch:
            children.append(self.arrow_patch)
        return children

    def set_figure(self, fig):

        if self.arrow_patch is not None:
            self.arrow_patch.set_figure(fig)
        self.offsetbox.set_figure(fig)
        martist.Artist.set_figure(self, fig)

    def set_fontsize(self, s=None):
#.........这里部分代码省略.........
开发者ID:AlexSzatmary,项目名称:matplotlib,代码行数:103,代码来源:offsetbox.py

示例6: draw

# 需要导入模块: from matplotlib.patches import FancyArrowPatch [as 别名]
# 或者: from matplotlib.patches.FancyArrowPatch import draw [as 别名]
 def draw(self,renderer):
   xp,yp,zp = proj3d.proj_transform(*self.verts,M=renderer.M)
   self.set_positions((xp[0],yp[0]),(xp[1],yp[1]))
   FancyArrowPatch.draw(self,renderer)
开发者ID:samhaug,项目名称:tplot,代码行数:6,代码来源:axes3d.py


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