Skip to content

Commit

Permalink
Merge remote-tracking branch 'matplotlib/v1.5.x' into v2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tacaswell committed May 22, 2016
2 parents 95cbca4 + 2fa27af commit 8e57552
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 17 deletions.
7 changes: 5 additions & 2 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,11 @@ matplotlib with a user interface toolkit. See
:ref:`what-is-a-backend` for more details on the optional matplotlib
backends and the capabilities they provide.

:term:`tk` 8.3 or later
The TCL/Tk widgets library used by the TkAgg backend
:term:`tk` 8.3 or later, not 8.6.0 or 8.6.1
The TCL/Tk widgets library used by the TkAgg backend.

Versions 8.6.0 and 8.6.1 are known to have issues that may result
in segfaults when closing multiple windows in the wrong order.

:term:`pyqt` 4.0 or later
The Qt4 widgets library python wrappers for the Qt4Agg backend
Expand Down
Binary file modified doc/_static/boxplot_explanation.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/numfocus_badge.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion doc/_templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ <h1>Citing matplotlib</h1>
</p>

<h1>Open source</h1>

<img src="_static/numfocus_badge.png" alt="A Fiscally Sponsored Project of NUMFocus"
style="float:right; margin-left:20px" />
<p>
Please
consider <a href="https://www.flipcause.com/widget/MjI1OA==">donating
Expand Down
2 changes: 1 addition & 1 deletion doc/faq/virtualenv_faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ implemented in a script as below. To use this modify ``PYVER`` and
PYTHON=${PATHTOPYTHON}python${PYVER}
# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`
ENV=`$PYTHON -c "import os; print(os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..')))"`
# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV
Expand Down
2 changes: 1 addition & 1 deletion doc/users/colormaps.rst
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ printed in grayscale.
Color vision deficiencies
=========================

There is a lot of information available about color blindness available (*e.g.*,
There is a lot of information available about color blindness (*e.g.*,
[colorblindness]_). Additionally, there are tools available to convert images to
how they look for different types of color vision deficiencies (*e.g.*, [asp]_).

Expand Down
25 changes: 13 additions & 12 deletions doc/users/event_handling.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ was pressed::
ax.plot(np.random.rand(10))

def onclick(event):
print 'button=%d, x=%d, y=%d, xdata=%f, ydata=%f'%(
event.button, event.x, event.y, event.xdata, event.ydata)
print('button=%d, x=%d, y=%d, xdata=%f, ydata=%f' %
(event.button, event.x, event.y, event.xdata, event.ydata))

cid = fig.canvas.mpl_connect('button_press_event', onclick)

Expand Down Expand Up @@ -128,7 +128,7 @@ is created every time a mouse is pressed::
self.cid = line.figure.canvas.mpl_connect('button_press_event', self)

def __call__(self, event):
print 'click', event
print('click', event)
if event.inaxes!=self.line.axes: return
self.xs.append(event.xdata)
self.ys.append(event.ydata)
Expand Down Expand Up @@ -196,7 +196,7 @@ Here is the solution::

contains, attrd = self.rect.contains(event)
if not contains: return
print 'event contains', self.rect.xy
print('event contains', self.rect.xy)
x0, y0 = self.rect.xy
self.press = x0, y0, event.xdata, event.ydata

Expand All @@ -207,7 +207,8 @@ Here is the solution::
x0, y0, xpress, ypress = self.press
dx = event.xdata - xpress
dy = event.ydata - ypress
#print 'x0=%f, xpress=%f, event.xdata=%f, dx=%f, x0+dx=%f'%(x0, xpress, event.xdata, dx, x0+dx)
#print('x0=%f, xpress=%f, event.xdata=%f, dx=%f, x0+dx=%f' %
# (x0, xpress, event.xdata, dx, x0+dx))
self.rect.set_x(x0+dx)
self.rect.set_y(y0+dy)

Expand Down Expand Up @@ -271,7 +272,7 @@ Extra credit solution::
if DraggableRectangle.lock is not None: return
contains, attrd = self.rect.contains(event)
if not contains: return
print 'event contains', self.rect.xy
print('event contains', self.rect.xy)
x0, y0 = self.rect.xy
self.press = x0, y0, event.xdata, event.ydata
DraggableRectangle.lock = self
Expand Down Expand Up @@ -361,22 +362,22 @@ background that the mouse is over::
import matplotlib.pyplot as plt

def enter_axes(event):
print 'enter_axes', event.inaxes
print('enter_axes', event.inaxes)
event.inaxes.patch.set_facecolor('yellow')
event.canvas.draw()

def leave_axes(event):
print 'leave_axes', event.inaxes
print('leave_axes', event.inaxes)
event.inaxes.patch.set_facecolor('white')
event.canvas.draw()

def enter_figure(event):
print 'enter_figure', event.canvas.figure
print('enter_figure', event.canvas.figure)
event.canvas.figure.patch.set_facecolor('red')
event.canvas.draw()

def leave_figure(event):
print 'leave_figure', event.canvas.figure
print('leave_figure', event.canvas.figure)
event.canvas.figure.patch.set_facecolor('grey')
event.canvas.draw()

Expand All @@ -403,7 +404,6 @@ background that the mouse is over::
plt.show()



.. _object-picking:

Object picking
Expand Down Expand Up @@ -503,7 +503,8 @@ properties of the line. Here is the code::
xdata = thisline.get_xdata()
ydata = thisline.get_ydata()
ind = event.ind
print 'onpick points:', zip(xdata[ind], ydata[ind])
points = tuple(zip(xdata[ind], ydata[ind]))
print('onpick points:', points)

fig.canvas.mpl_connect('pick_event', onpick)

Expand Down

0 comments on commit 8e57552

Please sign in to comment.