From 1cf39cf40ea514bfab2e26839fdd96587c5204ea Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 12 Dec 2013 16:36:48 -0600 Subject: [PATCH 1/3] modified example to reflect removal of NavigationToolbar2QTAgg --- examples/user_interfaces/embedding_in_qt4_wtoolbar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/user_interfaces/embedding_in_qt4_wtoolbar.py b/examples/user_interfaces/embedding_in_qt4_wtoolbar.py index c8688bd7cefe..b087e9d73dfd 100644 --- a/examples/user_interfaces/embedding_in_qt4_wtoolbar.py +++ b/examples/user_interfaces/embedding_in_qt4_wtoolbar.py @@ -7,7 +7,7 @@ from matplotlib.backend_bases import key_press_handler from matplotlib.backends.backend_qt4agg import ( FigureCanvasQTAgg as FigureCanvas, - NavigationToolbar2QTAgg as NavigationToolbar) + NavigationToolbar2QT as NavigationToolbar) from matplotlib.backends import qt4_compat use_pyside = qt4_compat.QT_API == qt4_compat.QT_API_PYSIDE From 30c16830645f0467d0f46e79e34b7970c6825b6b Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Thu, 12 Dec 2013 16:39:31 -0600 Subject: [PATCH 2/3] house keeping for #2629 Added NavigationToolbar2QTAgg back with a deprecation warning Added entry to api_changes.rst --- doc/api/api_changes.rst | 3 +++ lib/matplotlib/backends/backend_qt4agg.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) diff --git a/doc/api/api_changes.rst b/doc/api/api_changes.rst index 7e70a16e68c7..88b1e8e7c17f 100644 --- a/doc/api/api_changes.rst +++ b/doc/api/api_changes.rst @@ -116,6 +116,9 @@ original location: * The ``fmt`` argument of :meth:`~matplotlib.axes.Axes.plot_date` has been changed from ``bo`` to just ``o``, so color cycling can happen by default. +* Removed the class `FigureManagerQTAgg` and deprecated `NavigationToolbar2QTAgg` + which will be removed in 1.5. + .. _changes_in_1_3: diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index 5a6c74d1985c..a3b14996b19f 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -9,6 +9,7 @@ import os # not used import sys import ctypes +import warnings import matplotlib from matplotlib.figure import Figure @@ -24,6 +25,7 @@ from .backend_qt4 import draw_if_interactive from .backend_qt4 import backend_version ###### +from matplotlib.cbook import mplDeprecation DEBUG = False @@ -168,5 +170,15 @@ def print_figure(self, *args, **kwargs): self.draw() +class NavigationToolbar2QTAgg(NavigationToolbar2QT): + def __init__(*args, **kwargs): + warnings.warn('This class has been depreciated in 1.4 ' + + 'as it has no additional functionality over ' + + '`NavigationToolbar2QT`. Please change your code to ' + 'use `NavigationToolbar2QT` instead', + mplDeprecation) + NavigationToolbar2QT.__init__(*args, **kwargs) + + FigureCanvas = FigureCanvasQTAgg FigureManager = FigureManagerQT From 6ca7268b292ffb70e18bbc6d6e2f73dff95445e6 Mon Sep 17 00:00:00 2001 From: Thomas A Caswell Date: Sat, 14 Dec 2013 12:01:57 -0600 Subject: [PATCH 3/3] fix depreciate -> deprecate --- lib/matplotlib/backends/backend_qt4agg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/matplotlib/backends/backend_qt4agg.py b/lib/matplotlib/backends/backend_qt4agg.py index a3b14996b19f..ce6a06016e14 100644 --- a/lib/matplotlib/backends/backend_qt4agg.py +++ b/lib/matplotlib/backends/backend_qt4agg.py @@ -172,7 +172,7 @@ def print_figure(self, *args, **kwargs): class NavigationToolbar2QTAgg(NavigationToolbar2QT): def __init__(*args, **kwargs): - warnings.warn('This class has been depreciated in 1.4 ' + + warnings.warn('This class has been deprecated in 1.4 ' + 'as it has no additional functionality over ' + '`NavigationToolbar2QT`. Please change your code to ' 'use `NavigationToolbar2QT` instead', pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy