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


Python image.BboxImage方法代码示例

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


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

示例1: imagesAsTickMarks

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def imagesAsTickMarks(ax, images):
    TICKYPOS = -.6
    lowerCorner = ax.transData.transform((.8,TICKYPOS-.2))
    upperCorner = ax.transData.transform((1.2,TICKYPOS+.2))
    print(lowerCorner)
    print(upperCorner)
    bbox_image = BboxImage(Bbox([lowerCorner[0],
                                 lowerCorner[1],
                                 upperCorner[0],
                                 upperCorner[1],
                                 ]),
                           norm = None,
                           origin=None,
                           clip_on=False,
                           )

    image = imread(images[0])
    print('img loaded')
    bbox_image.set_data(image)
    ax.add_artist(bbox_image) 
开发者ID:Charestlab,项目名称:pyrsa,代码行数:22,代码来源:imagesAsTickMarks.py

示例2: __init__

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def __init__(self, arr,
                 zoom=1,
                 cmap=None,
                 norm=None,
                 interpolation=None,
                 origin=None,
                 filternorm=1,
                 filterrad=4.0,
                 resample=False,
                 dpi_cor=True,
                 **kwargs
                 ):

        self._dpi_cor = dpi_cor

        self.image = BboxImage(bbox=self.get_window_extent,
                               cmap=cmap,
                               norm=norm,
                               interpolation=interpolation,
                               origin=origin,
                               filternorm=filternorm,
                               filterrad=filterrad,
                               resample=resample,
                               **kwargs
                               )

        self._children = [self.image]

        self.set_zoom(zoom)
        self.set_data(arr)

        OffsetBox.__init__(self) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:34,代码来源:offsetbox.py

示例3: __init__

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def __init__(self, arr,
                 zoom=1,
                 cmap=None,
                 norm=None,
                 interpolation=None,
                 origin=None,
                 filternorm=1,
                 filterrad=4.0,
                 resample=False,
                 dpi_cor=True,
                 **kwargs
                 ):

        OffsetBox.__init__(self)
        self._dpi_cor = dpi_cor

        self.image = BboxImage(bbox=self.get_window_extent,
                               cmap=cmap,
                               norm=norm,
                               interpolation=interpolation,
                               origin=origin,
                               filternorm=filternorm,
                               filterrad=filterrad,
                               resample=resample,
                               **kwargs
                               )

        self._children = [self.image]

        self.set_zoom(zoom)
        self.set_data(arr) 
开发者ID:PacktPublishing,项目名称:Mastering-Elasticsearch-7.0,代码行数:33,代码来源:offsetbox.py

示例4: test_bbox_image_inverted

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def test_bbox_image_inverted():
    # This is just used to produce an image to feed to BboxImage
    fig = plt.figure()
    axes = fig.add_subplot(111)
    axes.plot([1, 2, 3])

    im_buffer = io.BytesIO()
    fig.savefig(im_buffer)
    im_buffer.seek(0)
    image = imread(im_buffer)

    bbox_im = BboxImage(Bbox([[100, 100], [0, 0]]))
    bbox_im.set_data(image)
    axes.add_artist(bbox_im) 
开发者ID:miloharper,项目名称:neural-network-animation,代码行数:16,代码来源:test_image.py

示例5: _init_bbox_image

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def _init_bbox_image(self, im):

        bbox_image = BboxImage(self.get_window_extent,
                               norm=None,
                               origin=None,
                               )
        bbox_image.set_transform(IdentityTransform())

        bbox_image.set_data(im)
        self.bbox_image = bbox_image 
开发者ID:holzschu,项目名称:python3_ios,代码行数:12,代码来源:demo_text_path.py

示例6: imagesAtPositions

# 需要导入模块: from matplotlib import image [as 别名]
# 或者: from matplotlib.image import BboxImage [as 别名]
def imagesAtPositions(ax, images, positions):
    for s in range(len(positions)):
        #print(positions[s,:])
        bbox = Bbox(corners(ax, positions[s,:],20))
        bbox_image = BboxImage(bbox)
        image = imread(images[s])
        bbox_image.set_data(image)
        ax.add_artist(bbox_image) 
开发者ID:Charestlab,项目名称:pyrsa,代码行数:10,代码来源:imagesAsTickMarks.py


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