marsilea.plotter.Image#

class Image(*args, **kwargs)#

Bases: RenderPlan

Plot static images

Parameters:
imagesarray of image

You can input either path to the image, URL, or numpy array.

align{“center”, “top”, “bottom”, “left”, “right”}, default: “center”

The alignment of the images.

scalefloat, default: 1

The scale of the images.

spacingfloat, default: 0.1

The spacing between images, a value between 0 and 1, relative to the image container size.

resizeint or tuple, default: None

The size to resize the images.

Examples

>>> import numpy as np
>>> import marsilea as ma
>>> c = ma.ZeroWidth(height=2)
>>> c.add_right(
...     ma.plotter.Image(
...         [
...             "https://upload.wikimedia.org/wikipedia/commons/thumb/c/c3/Python-logo-notext.svg/250px-Python-logo-notext.svg.png",
...             "https://upload.wikimedia.org/wikipedia/commons/thumb/d/d5/Rust_programming_language_black_logo.svg/250px-Rust_programming_language_black_logo.svg.png",
...             "https://upload.wikimedia.org/wikipedia/commons/thumb/6/6a/JavaScript-logo.png/250px-JavaScript-logo.png",
...         ],
...         align="right",
...     ),
...     pad=0.1,
... )
>>> c.add_right(
...     ma.plotter.Labels(["Python", "Rust", "JavaScript"], fontsize=20),
...     pad=0.1,
... )
>>> c.render()
../../_images/marsilea-plotter-Image-1.png