Picture

class Picture(impl=None)

The picture object is a member of the pictures collection:

>>> import xlwings as xw
>>> sht = xw.books['Book1'].sheets[0]
>>> sht.pictures[0]  # or sht.charts['PictureName']
<Picture 'Picture 1' in <Sheet [Book1]Sheet1>>

バージョン 0.9.0 で変更.

property api: Any

Returns the native object (pywin32 or appscript obj) of the engine being used.

Added in version 0.9.0.

delete()

Picureを削除します。

Added in version 0.5.0.

property height: float

Pictureの高さを表すポイント単位の数値を取得または設定します。

Added in version 0.5.0.

property left: float

Pictureの水平位置を表すポイント単位の数値を取得または設定します。

Added in version 0.5.0.

property lock_aspect_ratio: bool

True will keep the original proportion, False will allow you to change height and width independently of each other (read/write).

Added in version 0.24.0.

property name: str

Picrtureの名前を取得または設定します。

Added in version 0.5.0.

property parent: Sheet

Pictureの親オブジェクトを返します。

Added in version 0.9.0.

property top: float

Pictureの垂直位置を表すポイント単位の数値を取得または設定します。

Added in version 0.5.0.

update(image, format=None, export_options=None)

既存のPictureを新しいPictureで置き換えます。既存のPictureのアトリビュートは新しいPictureに引き継がれます。

パラメータ:
  • image (str | PathLike[str] | Any) -- ファイルパスまたはMatplotlibのFigureオブジェクト。

  • format (str | None) -- See under Pictures.add()

  • export_options (dict[str, Any] | None) -- See under Pictures.add()

Added in version 0.5.0.

property width: float

Pictureの幅を表すポイント単位の数値を取得または設定します。

Added in version 0.5.0.