Graphical user interfaces (GUIs) are convenient tools to input user data to your Python program. In all likelihood, you have used tools such as selection lists, radio buttons, or sliders to communicate with an application. In this chapter, we show how to add some of these tools to your program. We base this chapter on tools provided by the module Matplotlib, which we already met in Section 6.2: Working with Matplotlib objects directly.
Although there are alternatives such as the module Tkinter for a more sophisticated design of GUIs, Matplotlib appears as an ideal entry point with a low threshold to add this comfortable way of communicating with your code.
The purpose of this chapter is to demonstrate the basic principles of GUI programming within Matplotlib. The role of events, slider movements, or mouse clicks and their interaction...