ebook img

Python Graphics: A Reference for Creating 2D and 3D Images PDF

358 Pages·2018·15.56 MB·English
Save to my drive
Quick download
Download
Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.

Preview Python Graphics: A Reference for Creating 2D and 3D Images

B. J. Korites Python Graphics A Reference for Creating 2D and 3D Images B. J. Korites Duxbury, Massachusetts, USA Any source code or other supplementary material referenced by the author in this book is available to readers on GitHub via the book’s product page, located at www.apress.com/9781484233771 . For more detailed information, please visit www.apress.com/source-code . ISBN 978-1-48423377-1 e-ISBN 978-1-4842-3378-8 https://doi.org/10.1007/978-1-4842-3378-8 Library of Congress Control Number: 2018946635 © B.J. Korites 2018 This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed. Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark. The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights. While the advice and information in this book are believed to be true and accurate at the date of publication, neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material contained herein. the material contained herein. Distributed to the book trade worldwide by Springer Science+Business Media New York, 233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800- SPRINGER, fax (201) 348-4505, e-mail [email protected], or visit www.springeronline.com. Apress Media, LLC is a California LLC and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a Delaware corporation. For Pam Acknowledgments I would like to thank my wife, Pam, for her patience during the many long days and nights that I spent writing this book and for her understanding of the distant stare I sometimes had while off in another world thinking of math and Python, two of life’s great joys. I would also like to thank everyone at Apress, especially editors Todd Green and Jill Balzano, who made the production of this book a fast and seamless process. Table of Contents Chapter 1: Essential Python Commands and Functions 1.1 Programming Style 1.2 The Plotting Area 1.3 Establishing the Size of the Plotting Area 1.4 Importing Plotting Commands 1.5 Displaying the Plotting Area 1.6 The Plotting Grid 1.7 Saving a Plot 1.8 Grid Color 1.9 Tick Marks 1.10 Custom Grid Lines 1.11 Labelling the Axes 1.12 The Plot Title 1.13 Colors 1.13.1 Color Mixing 1.13.2 Color Intensity 1.14 Overplotting 1.15 Background Color 1.16 The Plotting Area Shape 1.17 How to Correct Shape Distortions 1.17.1 Applying a Scale Factor When Plotting 1.17.2 The Best Way: Scaling the Axes in plt.axis( ) 1.18 Coordinate Axes 1.19 Commonly Used Plotting Commands and Functions 1.19.1 Points and Dots Using scatter( ) 1.19.2 Lines Using plot( ) 1.19.3 Arrows 1.19.4 Text 1.19.5 Lists, Tuples, and Arrays 1.19.6 Arrays 1.19.7 arange( ) 1.19.8 range( ) 1.20 Summary Chapter 2: Graphics in Two Dimensions 2.1 Lines from Dots 2.2 Dot Art 2.3 Circular Arcs from Dots 2.4 Circular Arcs from Line Segments 2.5 Circles 2.6 Dot Discs 2.7 Ellipses 2.8 2D Translation 2.9 2D Rotation 2.10 Summary Chapter 3: Graphics in Three Dimensions 3.1 The Three-Dimensional Coordinate System 3.2 Projections onto the Coordinate Planes 3.3 Rotation Around the y Direction 3.4 Rotation Around the x Direction 3.5 Rotation Around the z Direction 3.6 Separate Rotations Around the Coordinate Directions 3.7 Sequential Rotations Around the Coordinate Directions 3.8 Matrix Concatenation 3.9 Keyboard Data Entry with Functional Program Structure 3.10 Summary Chapter 4: Perspective 4.1 Summary Chapter 5: Intersections 5.1 Line Intersecting a Rectangular Plane 5.2 Line Intersecting a Triangular Plane 5.3 Line Intersecting a Circle 5.4 Line Intersecting a Circular Sector 5.5 Line Intersecting a Sphere 5.6 Plane Intersecting a Sphere 5.7 Summary Chapter 6: Hidden Line Removal 6.1 Box 6.2 Pyramid 6.3 Planes 6.4 Sphere 6.5 Summary Chapter 7: Shading 7.1 Shading a Box 7.2 Shading a Sphere 7.3 Summary Chapter 8: 2D Data Plotting 8.1 Linear Regression 8.2 Function Fitting 8.3 Splines 8.4 Summary Chapter 9: 3D Data Plotting 9.1 3D Surfaces

Description:
Use built-in Python features to create innovative graphics for data visualization and technical illustrations. This book goes beyond simple commands and libraries to explain how to not only display but also rotate, shade, and edit graphics for any purpose. Starting with the essential Python functio
See more

The list of books you might like

Most books are stored in the elastic cloud where traffic is expensive. For this reason, we have a limit on daily download.