本文整理汇总了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)
示例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)
示例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)
示例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)
示例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
示例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)