コード例 #1
0
 def __init__(self, center, radius, matrix, **kwargs):
     Patch.__init__(self, **kwargs)
     path = Path.unit_circle()
     self.radius = radius
     self._code3d = path.codes
     self._segment3d = center + radius * (path.vertices @ matrix.T)
     self._path2d = Path(np.zeros((0, 2)))
コード例 #2
0
ファイル: inset_locator.py プロジェクト: fhelmli/homeNOWG2
   def __init__(self, bbox, **kwargs):
        if "transform" in kwargs:
           raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
コード例 #3
0
ファイル: inset_locator.py プロジェクト: 7924102/matplotlib
    def __init__(self, bbox, **kwargs):
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
コード例 #4
0
 def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
     """
     *path* is a :class:`matplotlib.path.Path` object.
     Valid kwargs are:
     %(Patch)s
     .. seealso::
         :class:`Patch`
             For additional kwargs
     """
     if "transform" in kwargs:
        raise ValueError("trnasform should nt be set")
     kwargs["transform"] = IdentityTransform()
     Patch.__init__(self, **kwargs)
     self.bbox1 = bbox1
     self.bbox2 = bbox2
     self.loc1 = loc1
     self.loc2 = loc2
コード例 #5
0
    def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
        """
        Connect two bboxes with a straight line.

        Parameters
        ----------
        bbox1, bbox2 : `matplotlib.transforms.Bbox`
            Bounding boxes to connect.

        loc1 : {1, 2, 3, 4}
            Corner of *bbox1* to draw the line. Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        loc2 : {1, 2, 3, 4}, optional
            Corner of *bbox2* to draw the line. If None, defaults to *loc1*.
            Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        **kwargs
            Patch properties for the line drawn. Valid arguments include:
            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        if 'fill' in kwargs:
            Patch.__init__(self, **kwargs)
        else:
            fill = ('fc' in kwargs) or ('facecolor' in kwargs) or ('color'
                                                                   in kwargs)
            Patch.__init__(self, fill=fill, **kwargs)
        self.bbox1 = bbox1
        self.bbox2 = bbox2
        self.loc1 = loc1
        self.loc2 = loc2
コード例 #6
0
ファイル: inset_locator.py プロジェクト: QuLogic/matplotlib
    def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
        """
        Connect two bboxes with a straight line.

        Parameters
        ----------
        bbox1, bbox2 : `matplotlib.transforms.Bbox`
            Bounding boxes to connect.

        loc1 : {1, 2, 3, 4}
            Corner of *bbox1* to draw the line. Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        loc2 : {1, 2, 3, 4}, optional
            Corner of *bbox2* to draw the line. If None, defaults to *loc1*.
            Valid values are::

                'upper right'  : 1,
                'upper left'   : 2,
                'lower left'   : 3,
                'lower right'  : 4

        **kwargs
            Patch properties for the line drawn. Valid arguments include:

            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        if 'fill' in kwargs:
            Patch.__init__(self, **kwargs)
        else:
            fill = bool({'fc', 'facecolor', 'color'}.intersection(kwargs))
            Patch.__init__(self, fill=fill, **kwargs)
        self.bbox1 = bbox1
        self.bbox2 = bbox2
        self.loc1 = loc1
        self.loc2 = loc2
コード例 #7
0
    def __init__(self, bbox, **kwargs):
        """
        Patch showing the shape bounded by a Bbox.

        Parameters
        ----------
        bbox : `matplotlib.transforms.Bbox`
            Bbox to use for the extents of this patch.

        **kwargs
            Patch properties. Valid arguments include:
            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
コード例 #8
0
    def __init__(self, bbox, **kwargs):
        """
        Patch showing the shape bounded by a Bbox.

        Parameters
        ----------
        bbox : `matplotlib.transforms.Bbox`
            Bbox to use for the extents of this patch.

        **kwargs
            Patch properties. Valid arguments include:
            %(Patch)s
        """
        if "transform" in kwargs:
            raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox = bbox
コード例 #9
0
ファイル: inset_locator.py プロジェクト: fhelmli/homeNOWG2
    def __init__(self, bbox1, bbox2, loc1, loc2=None, **kwargs):
        """
        *path* is a :class:`matplotlib.path.Path` object.

        Valid kwargs are:
        %(Patch)s

        .. seealso::

            :class:`Patch`
                For additional kwargs

        """
        if "transform" in kwargs:
           raise ValueError("transform should not be set")

        kwargs["transform"] = IdentityTransform()
        Patch.__init__(self, **kwargs)
        self.bbox1 = bbox1
        self.bbox2 = bbox2
        self.loc1 = loc1
        self.loc2 = loc2
コード例 #10
0
 def __init__(self, xy, radius, **kwargs):
     """
     xy : array_like
       center of two circles
     radius : scalar
       size of each circle
       
     Valid kwargs are:
     %(Patch)s
     """
     Patch.__init__(self, **kwargs)
     self.center = xy
     self.radius = radius
     self.width = 4. # two x unit circle (i.e. from +1 to -1)
     self.height = 2. # one x unit circle
     path = copy(Path.unit_circle())
     n_pts = path.vertices.shape[0]
     path.vertices = np.tile(path.vertices, [2,1])
     path.vertices[:n_pts,0] -= 1
     path.vertices[n_pts:,0] += 1
     path.codes = np.tile(path.codes, [2])
     self._path = path
     # Note: This cannot be calculated until this is added to an Axes
     self._patch_transform = transforms.IdentityTransform()
コード例 #11
0
ファイル: art3d.py プロジェクト: Aharobot/matplotlib
 def __init__(self, path, **kwargs):
     zs = kwargs.pop('zs', [])
     zdir = kwargs.pop('zdir', 'z')
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
コード例 #12
0
ファイル: art3d.py プロジェクト: stefanor/matplotlib
 def __init__(self, path, **kwargs):
     zs = kwargs.pop('zs', [])
     zdir = kwargs.pop('zdir', 'z')
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
コード例 #13
0
ファイル: art3d.py プロジェクト: akhila1729/matplotlib
 def __init__(self, path, *, zs=(), zdir='z', **kwargs):
     # Not super().__init__!
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
コード例 #14
0
 def __init__(self, *args, zs=(), zdir='z', **kwargs):
     Patch.__init__(self, *args, **kwargs)
     self.set_3d_properties(zs, zdir)
コード例 #15
0
ファイル: art3d.py プロジェクト: dopplershift/matplotlib
 def __init__(self, path, *, zs=(), zdir='z', **kwargs):
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)
コード例 #16
0
ファイル: art3d.py プロジェクト: JulianNymark/blendergame
 def __init__(self, path, **kwargs):
     zs = kwargs.pop("zs", [])
     zdir = kwargs.pop("zdir", "z")
     Patch.__init__(self, **kwargs)
     self.set_3d_properties(path, zs, zdir)