Skip to content
1 change: 1 addition & 0 deletions doc-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
sphinx>=1.3,!=1.5.0,!=1.6.4
colorspacious
ipython
ipywidgets
mock
numpydoc>=0.4
pillow
Expand Down
8 changes: 8 additions & 0 deletions doc/api/backend_agg_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_agg`
======================================

.. automodule:: matplotlib.backends.backend_agg
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions doc/api/backend_cairo_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_cairo`
========================================

.. automodule:: matplotlib.backends.backend_cairo
:members:
:undoc-members:
:show-inheritance:
11 changes: 11 additions & 0 deletions doc/api/backend_gtk3agg_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

:mod:`matplotlib.backends.backend_gtk3agg`
==========================================

**TODO** We'll add this later, importing the gtk3 backends requires an active
X-session, which is not compatible with cron jobs.

.. .. automodule:: matplotlib.backends.backend_gtk3agg
.. :members:
.. :undoc-members:
.. :show-inheritance:
11 changes: 11 additions & 0 deletions doc/api/backend_gtk3cairo_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

:mod:`matplotlib.backends.backend_gtk3cairo`
============================================

**TODO** We'll add this later, importing the gtk3 backends requires an active
X-session, which is not compatible with cron jobs.

.. .. automodule:: matplotlib.backends.backend_gtk3cairo
.. :members:
.. :undoc-members:
.. :show-inheritance:
11 changes: 11 additions & 0 deletions doc/api/backend_gtkcairo_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

:mod:`matplotlib.backends.backend_gtkcairo`
===========================================

**TODO** We'll add this later, importing the gtk backends requires an active
X-session, which is not compatible with cron jobs.

.. .. automodule:: matplotlib.backends.backend_gtkcairo
.. :members:
.. :undoc-members:
.. :show-inheritance:
2 changes: 1 addition & 1 deletion doc/api/backend_managers_api.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

:mod:`matplotlib.backend_managers`
===================================
==================================

.. automodule:: matplotlib.backend_managers
:members:
Expand Down
1 change: 1 addition & 0 deletions doc/api/backend_mixed_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_mixed
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions doc/api/backend_nbagg_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_nbagg`
========================================

.. automodule:: matplotlib.backends.backend_nbagg
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions doc/api/backend_pdf_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_pdf
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions doc/api/backend_pgf_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_pgf`
======================================

.. automodule:: matplotlib.backends.backend_pgf
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions doc/api/backend_ps_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_ps`
=====================================

.. automodule:: matplotlib.backends.backend_ps
:members:
:undoc-members:
:show-inheritance:
1 change: 0 additions & 1 deletion doc/api/backend_qt4agg_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletions doc/api/backend_qt4cairo_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_qt4cairo`
===========================================

.. automodule:: matplotlib.backends.backend_qt4cairo
:members:
:undoc-members:
:show-inheritance:
1 change: 0 additions & 1 deletion doc/api/backend_qt5agg_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletions doc/api/backend_qt5cairo_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_qt5cairo`
===========================================

.. automodule:: matplotlib.backends.backend_qt5cairo
:members:
:undoc-members:
:show-inheritance:
1 change: 1 addition & 0 deletions doc/api/backend_svg_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_svg
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletions doc/api/backend_tkagg_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_tkagg`
========================================

.. automodule:: matplotlib.backends.backend_tkagg
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion doc/api/backend_tools_api.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

:mod:`matplotlib.backend_tools`
================================
===============================

.. automodule:: matplotlib.backend_tools
:members:
Expand Down
12 changes: 12 additions & 0 deletions doc/api/backend_webagg_api.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

:mod:`matplotlib.backends.backend_webagg`
=========================================

.. note::
The WebAgg backend is not documented here, in order to avoid adding Tornado
to the doc build requirements.

.. .. automodule:: matplotlib.backends.backend_webagg
.. :members:
.. :undoc-members:
.. :show-inheritance:
19 changes: 14 additions & 5 deletions doc/api/index_backend_api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,21 @@ backends
backend_managers_api.rst
backend_mixed_api.rst
backend_tools_api.rst
backend_agg_api.rst
backend_cairo_api.rst
backend_gtkagg_api.rst
backend_gtkcairo_api.rst
backend_gtk3agg_api.rst
backend_gtk3cairo_api.rst
backend_nbagg_api.rst
backend_pdf_api.rst
backend_pgf_api.rst
backend_ps_api.rst
backend_qt4agg_api.rst
backend_qt4cairo_api.rst
backend_qt5agg_api.rst
backend_wxagg_api.rst
backend_pdf_api.rst
backend_qt5cairo_api.rst
backend_svg_api.rst
.. backend_webagg.rst
dviread.rst
type1font.rst
backend_tkagg_api.rst
backend_webagg_api.rst
backend_wxagg_api.rst
40 changes: 21 additions & 19 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -335,17 +335,8 @@ def _check_deps():
]


class MyWX(MagicMock):
class Panel(object):
pass

class ToolBar(object):
pass

class Frame(object):
pass

VERSION_STRING = '2.9'
class MyCairo(MagicMock):
version_info = (1, 2, 0)


class MyPyQt4(MagicMock):
Expand Down Expand Up @@ -450,14 +441,25 @@ def getapi(*args):
return 1


mockwxversion = MagicMock()
mockwx = MyWX()
mocksip = MySip()
mockpyqt4 = MyPyQt4()
sys.modules['wxversion'] = mockwxversion
sys.modules['wx'] = mockwx
sys.modules['sip'] = mocksip
sys.modules['PyQt4'] = mockpyqt4
class MyWX(MagicMock):
class Panel(object):
pass

class ToolBar(object):
pass

class Frame(object):
pass

VERSION_STRING = '2.9'


sys.modules['cairo'] = MyCairo()
sys.modules['cairo'].__name__ = 'cairocffi'
sys.modules['PyQt4'] = MyPyQt4()
sys.modules['sip'] = MySip()
sys.modules['wx'] = MyWX()
sys.modules['wxversion'] = MagicMock()

# numpydoc config

Expand Down
5 changes: 5 additions & 0 deletions doc/users/whats_new/qtcairo.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Cairo rendering for Qt canvases
-------------------------------

The new ``Qt4Cairo`` and ``Qt5Cairo`` backends allow Qt canvases to use Cairo
rendering instead of Agg.
5 changes: 2 additions & 3 deletions examples/showcase/mandelbrot.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,9 @@ def mandelbrot_set(xmin, xmax, ymin, ymax, xn, yn, maxiter, horizon=2.0):

# Some advertisement for matplotlib
year = time.strftime("%Y")
major, minor, micro = matplotlib.__version__.split('.', 2)
text = ("The Mandelbrot fractal set\n"
"Rendered with matplotlib %s.%s, %s - http://matplotlib.org"
% (major, minor, year))
"Rendered with matplotlib %s, %s - http://matplotlib.org"
% (matplotlib.__version__, year))
ax.text(xmin+.025, ymin+.025, text, color="white", fontsize=12, alpha=0.5)

plt.show()
10 changes: 5 additions & 5 deletions lib/matplotlib/backends/backend_agg.py
Original file line number Diff line number Diff line change
Expand Up @@ -422,18 +422,18 @@ def draw(self):
Draw the figure using the renderer
"""
self.renderer = self.get_renderer(cleared=True)
# acquire a lock on the shared font cache
RendererAgg.lock.acquire()

toolbar = self.toolbar
try:
if toolbar:
toolbar.set_cursor(cursors.WAIT)
self.figure.draw(self.renderer)
with RendererAgg.lock:
self.figure.draw(self.renderer)
# A GUI class may be need to update a window using this draw, so
# don't forget to call the superclass.
super(FigureCanvasAgg, self).draw()
finally:
if toolbar:
toolbar.set_cursor(toolbar._lastCursor)
RendererAgg.lock.release()

def get_renderer(self, cleared=False):
l, b, w, h = self.figure.bbox.bounds
Expand Down
Loading