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

GUI neutral widgets

This section describes a selection of the different kinds of widgets along with how to add interactivity to these widgets using callbacks.

How to add the basic GUI neutral widgets

We will begin by taking a look at cursor. The cursor will generate a widget that places little x axis and y axis cursors over the top of the axis. The first argument to any widget is the axis that we want to attach it to. In this case, we want to attach it to the current axis. By doing this, by default, it should look unchanged.

  1. However, as we hover over the plot, we get the XY cursor, as shown in the following output after the code:
# Basic cursor
nums = np.arange(0,10,0.1)
plt.plot(nums, np.sin(nums))
Cursor(plt.gca())

Following...

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