🧪 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 draw_line

Draw a simple line. This is part of the reference section.

Purpose

Draw a line between two points.

Snippet

Draw a line starting at x coordinate of 50 and y coordinate of 100 going to x coordinate of 150 and y coordinate of 200.
sketch.draw_line(50, 100, 150, 200)

Parameters

  • x1: The x coordinate from which the line should be drawn.
  • y1: The y coordinate from which the line should be drawn.
  • x2: The x coordinate to which the line should be drawn.
  • y2: The y coordinate to which the line should be drawn.

Examples

Availability

Available for all platforms.

See also