Conditional Looping and Real-Time Plots
John M. Essick · 2024
Abstract Readers learn to use Python’s conditional looping structure—the while loop—to create a real-time plot of a sine wave. The advantage of using Matplotlib’s animation module, along with its blitting feature, for real-time plots is explored and the method for placing an animation on a GUI is executed. The tuple data structure is defined, while the procedure for indexing and slicing iterable data structures (such as strings, lists, NumPy arrays, and tuples) is explained. A Do It Yourself project directs readers in writing a while-loop-based program that executes until it finds the solution that satisfies a given mathematical criterion, and a Use It! example demonstrates how to implement the break command to terminate program looping.