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