[Matplotlib-users] Ann: mpldatacursor v0.6 - Interactive annotation boxes for Matplotlib

Joe Kington joferkington at gmail.com
Sun Aug 16 23:40:47 CEST 2015


Hi folks,

mpldatacursor version 0.6 has been released (it's long overdue).
mpldatacursor provides interactive “data cursors” (clickable annotation
boxes) for matplotlib.
Major Changes in v0.6

Version 0.6 adds:

   - Better handling of date-formatted axes.
   - “Popup” text boxes can be interactively hidden by right-clicking
   (controllable through the hide_button and display_button kwargs).
   - Proper support for twinned axes.
   - Better unicode support for the formatter function. Note that this
   makes mpldatacursor incompatibile with early 3.x versions (3.0, 3.1, and
   3.2). However, it remains compatible with Python >= 3.3 (e.g. 3.3, 3.4, and
   3.5) as well as 2.6 and 2.7.
   - Annotation boxes will now try to stay visible inside the figure by
   default. Specify keep_inside=False to disable this.
   - Added basic support for extracting the z-value of 3D artists.
   - Made the precision of the default x & y formatting depend on the range
   of the axes.
   - Full support for interactive IPython notebooks through the nbagg
   backend. Note that the performance on the nbagg may be very poor.
   - Workarounds for annotation issues in Matplotlib v1.4.3
   - Numerous bugfixes (Thanks to everyone for the reports!).

Basic Usage

mpldatacursor offers a few different styles of interaction through the
datacursor function.

As an example, this displays the x, y coordinates of the selected artist in
an annotation box:

import matplotlib.pyplot as plt
import numpy as np
from mpldatacursor import datacursor

data = np.outer(range(10), range(1, 5))

fig, ax = plt.subplots()
lines = ax.plot(data)
ax.set_title('Click somewhere on a line')

datacursor(lines)

plt.show()

<https://github.com/joferkington/mpldatacursor/blob/master/examples/basic.py>
Installation

mpldatacursor can be installed from PyPi using easy_install/pip/etc. (e.g. pip
install mpldatacursor) or you may download the source and install it
directly with python setup.py install.


Thanks,

-Joe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/matplotlib-users/attachments/20150816/f22dbee9/attachment.html>


More information about the Matplotlib-users mailing list