8000 revert PR #1125 and #1201 · dmcdougall/matplotlib@b0807ae · GitHub
[go: up one dir, main page]

Skip to content

Commit b0807ae

Browse files
committed
The attempt to make OO use easier broke the Tkagg and Wx* backends.
1 parent 32dc947 commit b0807ae

27 files changed

+5
-64
lines changed

doc/users/whats_new.rst

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,6 @@ Features that depend on the Python Imaging Library, such as JPEG
4141
handling, do not work, since the version of PIL for Python 3.x is not
4242
sufficiently mature.
4343

44-
Object-oriented interface
45-
-------------------------
46-
47-
Damon McDougall has reduced some of the boilerplate code needed to interact
48-
with the object-oriented interface. Now a figure canvas is set up by default::
49-
50-
>>> from matplotlib.figure import Figure
51-
>>> fig = Figure()
52-
>>> ax = fig.add_subplot(1, 1, 1)
53-
>>> fig.savefig('figure.pdf')
54-
5544
PGF/TikZ backend
5645
----------------
5746
Peter Würtz wrote a backend that allows matplotlib to export figures as

lib/matplotlib/backends/backend_agg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -515,5 +515,3 @@ def print_to_buffer(self):
515515
(int(renderer.width), int(renderer.height)))
516516
renderer.dpi = original_dpi
517517
return result
518-
519-
FigureCanvas = FigureCanvasAgg

lib/matplotlib/backends/backend_cairo.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -512,5 +512,3 @@ def _save (self, fo, format, **kwargs):
512512

513513
ctx.show_page()
514514
surface.finish()
515-
516-
FigureCanvas = FigureCanvasCairo

lib/matplotlib/backends/backend_cocoaagg.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def stop_event_loop(self):
8989
FigureCanvasBase.stop_event_loop_default(self)
9090
stop_event_loop.__doc__=FigureCanvasBase.stop_event_loop_default.__doc__
9191

92-
FigureCanvas = FigureCanvasCocoaAgg
92+
9393

9494
NibClassBuilder.extractClasses('Matplotlib.nib', mplBundle)
9595

lib/matplotlib/backends/backend_emf.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -727,8 +727,6 @@ def print_emf(self, filename, dpi=300, **kwargs):
727727
def get_default_filetype(self):
728728
return 'emf'
729729

730-
FigureCanvas = FigureCanvasEMF
731-
732730
class FigureManagerEMF(FigureManagerBase):
733731
"""
734732
Wrap everything up into a window for the pylab interface

lib/matplotlib/backends/backend_fltkagg.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -231,8 +231,6 @@ def stop_event_loop(self):
231231
FigureCanvasBase.stop_event_loop_default(self)
232232
stop_event_loop.__doc__=FigureCanvasBase.stop_event_loop_default.__doc__
233233

234-
FigureCanvas = FigureCanvasFltkAgg
235-
236234
def destroy_figure(ptr, figman):
237235
figman.window.hide()
238236
Fltk.Fl.wait(0) # This is needed to make the last figure vanish.

lib/matplotlib/backends/backend_gdk.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ def new_figure_manager_given_figure(num, figure):
434434
return manager
435435

436436

437-
class FigureCanvasGDK(FigureCanvasBase):
437+
class FigureCanvasGDK (FigureCanvasBase):
438438
def __init__(self, figure):
439439
FigureCanvasBase.__init__(self, figure)
440440

@@ -472,5 +472,3 @@ def _print_image(self, filename, format, *args, **kwargs):
472472
0, 0, 0, 0, width, height)
473473

474474
pixbuf.save(filename, format)
475-
476-
FigureCanvas = FigureCanvasGDK

lib/matplotlib/backends/backend_gtk.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def _on_timer(self):
144144
return False
145145

146146

147-
class FigureCanvasGTK(gtk.DrawingArea, FigureCanvasBase):
147+
class FigureCanvasGTK (gtk.DrawingArea, FigureCanvasBase):
148148
keyvald = {65507 : 'control',
149149
65505 : 'shift',
150150
65513 : 'alt',
@@ -519,8 +519,6 @@ def stop_event_loop(self):
519519
FigureCanvasBase.stop_event_loop_default(self)
520520
stop_event_loop.__doc__=FigureCanvasBase.stop_event_loop_default.__doc__
521521

522-
FigureCanvas = FigureCanvasGTK
523-
524522
class FigureManagerGTK(FigureManagerBase):
525523
"""
526524
Public attributes

lib/matplotlib/backends/backend_gtk3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def _on_timer(self):
9898
self._timer = None
9999
return False
100100

101-
class FigureCanvasGTK3(Gtk.DrawingArea, FigureCanvasBase):
101+
class FigureCanvasGTK3 (Gtk.DrawingArea, FigureCanvasBase):
102102
keyvald = {65507 : 'control',
103103
65505 : 'shift',
104104
65513 : 'alt',

lib/matplotlib/backends/backend_gtk3agg.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,6 @@ def print_png(self, filename, *args, **kwargs):
6767
agg = self.switch_backends(backend_agg.FigureCanvasAgg)
6868
return agg.print_png(filename, *args, **kwargs)
6969

70-
FigureCanvas = FigureCanvasGTK3Agg
7170

7271
class FigureManagerGTK3Agg(backend_gtk3.FigureManagerGTK3):
7372
pass

0 commit comments

Comments
 (0)
0