Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

cairo rendering for wx#9202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Closed
anntzer wants to merge17 commits intomatplotlib:masterfromanntzer:wxcairo
Closed
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
17 commits
Select commitHold shift + click to select a range
2abdcea
Qt5Cairo backend.
anntzerJun 15, 2017
d4957ec
Qt4Cairo backend.
anntzerJun 18, 2017
d2f2bc0
Update backends docs.
anntzerJun 18, 2017
f884ffa
Update backends API docs.
anntzerJun 18, 2017
bcb08e9
Let cairo track surface size; fix Pyside refcnt bug.
anntzerJun 19, 2017
2eac3fa
Fix mandelbrot example.
anntzerJun 20, 2017
138ba58
Make sure only one cairo binding is ever used; fix docs.
anntzerJun 20, 2017
d96d104
No need to process_updates in gtk3.
anntzerJul 23, 2017
5087c05
Qt dpi handling should be renderer-agnostic.
anntzerAug 1, 2017
89a87d0
Fix vector output from cairo.
anntzerAug 3, 2017
56854ae
In QtCairo, also save figures using cairo.
anntzerAug 3, 2017
ab61783
Fix doc builds.
anntzerAug 26, 2017
8946c38
Fix hidpi in qt5cairo.
anntzerDec 29, 2017
89a3ca8
Cleanup gtk3cairo.
anntzerSep 19, 2017
ecc9143
Cleanup wxagg.
anntzerSep 18, 2017
28ccff8
Unify wx toolbars.
anntzerSep 18, 2017
82e8360
WXCairo backend.
anntzerSep 18, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletionsdoc-requirements.txt
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_agg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_cairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_gtk3agg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_gtk3cairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_gtkcairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletiondoc/api/backend_managers_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@

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

.. automodule:: matplotlib.backend_managers
:members:
Expand Down
1 change: 1 addition & 0 deletionsdoc/api/backend_mixed_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_mixed
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdoc/api/backend_nbagg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_pdf_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_pdf
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdoc/api/backend_pgf_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_ps_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletiondoc/api/backend_qt4agg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,4 +6,3 @@
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletionsdoc/api/backend_qt4cairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletiondoc/api/backend_qt5agg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -6,4 +6,3 @@
:members:
:undoc-members:
:show-inheritance:

8 changes: 8 additions & 0 deletionsdoc/api/backend_qt5cairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionsdoc/api/backend_svg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -4,4 +4,5 @@

.. automodule:: matplotlib.backends.backend_svg
:members:
:undoc-members:
:show-inheritance:
8 changes: 8 additions & 0 deletionsdoc/api/backend_tkagg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletiondoc/api/backend_tools_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@

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

.. automodule:: matplotlib.backend_tools
:members:
Expand Down
12 changes: 12 additions & 0 deletionsdoc/api/backend_webagg_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff 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:
8 changes: 8 additions & 0 deletionsdoc/api/backend_wxcairo_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@

:mod:`matplotlib.backends.backend_wxcairo`
==========================================

..automodule::matplotlib.backends.backend_wxcairo
:members:
:undoc-members:
:show-inheritance:
20 changes: 15 additions & 5 deletionsdoc/api/index_backend_api.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -8,12 +8,22 @@ 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
backend_wxcairo_api.rst
32 changes: 13 additions & 19 deletionsdoc/conf.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 DownExpand Up@@ -450,14 +441,17 @@ 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):
Frame = Panel = Printout = ToolBar = type("", (), {})
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 deletionsdoc/users/whats_new/more-cairo.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
cairo rendering for Qt and WX canvases
--------------------------------------

The new ``Qt4Cairo``, ``Qt5Cairo``, and ``WXCairo`` backends allow Qt and WX
canvases to use cairo rendering instead of Agg.
5 changes: 2 additions & 3 deletionsexamples/showcase/mandelbrot.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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 deletionslib/matplotlib/backends/backend_agg.py
View file
Open in desktop
Original file line numberDiff line numberDiff 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

[8]ページ先頭

©2009-2025 Movatter.jp