🧪 Version 0.2.2 is our alpha release candidate. Please send us bug reports and suggestions!

Sketchingpy

Creative coding and interactive science everywhere for everyone: web, desktop, mobile, Jupyter, and more. Open source!

Reference for scale

Scale outwards from the current origin. This is part of the reference section.

Purpose

Change the transform matrix such that any drawing afterwards is scaled from the current origin.

Snippet

Scale 2x from the x coordinate of 50 and y coordinate of 100.
sketch.set_angle_mode('degrees')
sketch.translate(50, 100)
sketch.scale(2)

Parameters

  • scale: The factor by which to scale where values over 1 scale up and less than 1 scale down. A value of 1 will have no effect.

Examples

Availability

Available on all platforms.

See also