Documentation

Function defined in library pytamaro

compose(foreground_graphic, background_graphic)

composeforeground_graphicbackground_graphic

Creates a new graphic by composing the two provided graphics. The first graphic is kept in the foreground, the second one in the background. The graphics are aligned by superimposing their pinning positions.

The pinning position used to compose becomes the pinning position of the resulting graphic.

foreground_graphicgraphic in the foreground

background_graphicgraphic in the background

The resulting composed graphic
Code
show_graphic(compose(pin(top_right, rectangle(50, 50, blue)), pin(bottom_left, rectangle(100, 50, red))))
Output
Graphical output from execution result

PyTamaro logo

PyTamaro is a project created by the Lugano Computing Education Research Lab at the Software Institute of USI

Privacy Policy • Platform Version 7dd0569a (October 21, 2026 at 7:47:45 AM UTC)