Reader small image

You're reading from  Mastering Matplotlib 2.x

Product typeBook
Published inNov 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781789617696
Edition1st Edition
Languages
Right arrow
Author (1)
Benjamin Walter Keller
Benjamin Walter Keller
author image
Benjamin Walter Keller

Benjamin Walter Keller is currently a PhD candidate at McMaster University and gained his BSc in physics with a minor in computer science from the University of Calgary in 2011. His current research involves numerical modeling of galaxy evolution over cosmological timescales. As an undergraduate at the U of C, he worked on stacking radio polarization to examine faint extragalactic sources. He also worked in the POSSUM Working Group 2 to determine the requirements for stacking applications for the Australian SKA Pathfinder (ASKAP) radio telescope. He is particularly interested in questions involving stellar feedback (supernovae, stellar winds, and so on) and its impact on galaxies and their surrounding intergalactic medium.
Read more about Benjamin Walter Keller

Right arrow

Event handling with plot callbacks

This section describes how to add interactivity by capturing mouse events along with capturing keyboard clicks.

How to add interactivity by capturing mouse events

Initially, you must import everything that we normally use and use the interactive Notebook backend. Now, the user is not familiar with asynchronous programming with the callback function. This takes in an event, which is then called when that event occurs. The important information of that event is passed as an argument to that function.

We will begin by defining a function called draw_circle (event). These are the events that are passed by Matplotlib callbacks, and they include information about the event. So, in the case of a...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Mastering Matplotlib 2.x
Published in: Nov 2018Publisher: PacktISBN-13: 9781789617696

Author (1)

author image
Benjamin Walter Keller

Benjamin Walter Keller is currently a PhD candidate at McMaster University and gained his BSc in physics with a minor in computer science from the University of Calgary in 2011. His current research involves numerical modeling of galaxy evolution over cosmological timescales. As an undergraduate at the U of C, he worked on stacking radio polarization to examine faint extragalactic sources. He also worked in the POSSUM Working Group 2 to determine the requirements for stacking applications for the Australian SKA Pathfinder (ASKAP) radio telescope. He is particularly interested in questions involving stellar feedback (supernovae, stellar winds, and so on) and its impact on galaxies and their surrounding intergalactic medium.
Read more about Benjamin Walter Keller