Skip to content

Commit

Permalink
Add a GTK4 backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
QuLogic committed Sep 1, 2021
1 parent a142369 commit 0b724bf
Show file tree
Hide file tree
Showing 11 changed files with 978 additions and 17 deletions.
4 changes: 2 additions & 2 deletions lib/matplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -1098,8 +1098,8 @@ def use(backend, *, force=True):
backend names, which are case-insensitive:
- interactive backends:
GTK3Agg, GTK3Cairo, MacOSX, nbAgg, QtAgg, QtCairo,
TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo
GTK3Agg, GTK3Cairo, GTK4Agg, GTK4Cairo, MacOSX, nbAgg, QtAgg,
QtCairo, TkAgg, TkCairo, WebAgg, WX, WXAgg, WXCairo, Qt5Agg, Qt5Cairo
- non-interactive backends:
agg, cairo, pdf, pgf, ps, svg, template
Expand Down
5 changes: 3 additions & 2 deletions lib/matplotlib/backend_bases.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ def _safe_pyplot_import():
backend_mapping = {
'qt': 'qtagg',
'gtk3': 'gtk3agg',
'gtk4': 'gtk4agg',
'wx': 'wxagg',
'tk': 'tkagg',
'macosx': 'macosx',
Expand Down Expand Up @@ -1656,7 +1657,7 @@ class FigureCanvasBase:
A high-level figure instance.
"""

# Set to one of {"qt", "gtk3", "wx", "tk", "macosx"} if an
# Set to one of {"qt", "gtk3", "gtk4", "wx", "tk", "macosx"} if an
# interactive framework is required, or None otherwise.
required_interactive_framework = None

Expand Down Expand Up @@ -1732,7 +1733,7 @@ def _fix_ipython_backend2gui(cls):
# don't break on our side.
return
rif = getattr(cls, "required_interactive_framework", None)
backend2gui_rif = {"qt": "qt", "gtk3": "gtk3",
backend2gui_rif = {"qt": "qt", "gtk3": "gtk3", "gtk4": "gtk4",
"wx": "wx", "macosx": "osx"}.get(rif)
if backend2gui_rif:
if _is_non_interactive_terminal_ipython(ip):
Expand Down
Loading

0 comments on commit 0b724bf

Please sign in to comment.