Picture¶
- class Picture(impl: Any = None)¶
The picture object is a member of the
picturescollection:>>> import xlwings as xw >>> sht = xw.books['Book1'].sheets[0] >>> sht.pictures[0] # or sht.charts['PictureName'] <Picture 'Picture 1' in <Sheet [Book1]Sheet1>>
Changed in version 0.9.0.
- property api: Any¶
Returns the native object (
pywin32orappscriptobj) of the engine being used.Added in version 0.9.0.
- delete() None¶
Deletes the picture.
Added in version 0.5.0.
- property height: float¶
Returns or sets the number of points that represent the height of the picture.
Added in version 0.5.0.
- property left: float¶
Returns or sets the number of points that represent the horizontal position of the picture.
Added in version 0.5.0.
- property lock_aspect_ratio: bool¶
Truewill keep the original proportion,Falsewill allow you to change height and width independently of each other (read/write).Added in version 0.24.0.
- property name: str¶
Returns or sets the name of the picture.
Added in version 0.5.0.
- property top: float¶
Returns or sets the number of points that represent the vertical position of the picture.
Added in version 0.5.0.
- update(image: str | PathLike[str] | Any, format: str | None = None, export_options: dict[str, Any] | None = None) Picture¶
Replaces an existing picture with a new one, taking over the attributes of the existing picture.
Arguments¶
- imagestr or path-like object or matplotlib.figure.Figure
Either a filepath or a Matplotlib figure object.
- formatstr, default None
See under
Pictures.add()- export_optionsdict, default None
See under
Pictures.add()
Added in version 0.5.0.
- property width: float¶
Returns or sets the number of points that represent the width of the picture.
Added in version 0.5.0.