© Bernard Korites 2023
B. KoritesPython Graphicshttps://doi.org/10.1007/978-1-4842-9660-8_2

2. Graphics in Two Dimensions

Bernard Korites1  
(1)
Duxbury, MA, USA
 

In this chapter, you will learn how to construct two-dimensional images using points and lines. You learned the basic tools for creating images with Python in Chapter 1. In this chapter, you will expand on that and learn methods to create, translate, and rotate shapes in two dimensions. You will also learn about the concept of relative coordinates, which will be used extensively throughout the remainder of this book. As usual, you will explore these concepts through sample programs.

Lines from Dots

You saw how to create a line with the command
plt.plot([x1,x2],[y1,y2],attributes)

This ...

Get Python Graphics: A Reference for Creating 2D and 3D Images now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.