|
15 | 15 | import matplotlib.backends.windowing as windowing
|
16 | 16 |
|
17 | 17 | import matplotlib
|
18 |
| -from matplotlib import backend_tools, cbook, rcParams |
| 18 | +from matplotlib import backend_tools, rcParams |
19 | 19 | from matplotlib.backend_bases import (
|
20 | 20 | _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2,
|
21 | 21 | StatusbarBase, TimerBase, ToolContainerBase, cursors)
|
@@ -294,10 +294,6 @@ def _update_pointer_position(self, guiEvent=None):
|
294 | 294 | else:
|
295 | 295 | self.leave_notify_event(guiEvent)
|
296 | 296 |
|
297 |
| - show = cbook.deprecated("2.2", name="FigureCanvasTk.show", |
298 |
| - alternative="FigureCanvasTk.draw")( |
299 |
| - lambda self: self.draw()) |
300 |
| - |
301 | 297 | def draw_idle(self):
|
302 | 298 | 'update drawing area only if idle'
|
303 | 299 | if self._idle is False:
|
@@ -511,22 +507,8 @@ def _get_toolmanager(self):
|
511 | 507 | toolmanager = None
|
512 | 508 | return toolmanager
|
513 | 509 |
|
514 |
| - def resize(self, width, height=None): |
515 |
| - # before 09-12-22, the resize method takes a single *event* |
516 |
| - # parameter. On the other hand, the resize method of other |
517 |
| - # FigureManager class takes *width* and *height* parameter, |
518 |
| - # which is used to change the size of the window. For the |
519 |
| - # Figure.set_size_inches with forward=True work with Tk |
520 |
| - # backend, I changed the function signature but tried to keep |
521 |
| - # it backward compatible. -JJL |
522 |
| - |
523 |
| - # when a single parameter is given, consider it as a event |
524 |
| - if height is None: |
525 |
| - cbook.warn_deprecated("2.2", "FigureManagerTkAgg.resize now takes " |
526 |
| - "width and height as separate arguments") |
527 |
| - width = width.width |
528 |
| - else: |
529 |
| - self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) |
| 510 | + def resize(self, width, height): |
| 511 | + self.canvas._tkcanvas.master.geometry("%dx%d" % (width, height)) |
530 | 512 |
|
531 | 513 | if self.toolbar is not None:
|
532 | 514 | self.toolbar.configure(width=width)
|
@@ -572,70 +554,6 @@ def full_screen_toggle(self):
|
572 | 554 | self.window.attributes('-fullscreen', not is_fullscreen)
|
573 | 555 |
|
574 | 556 |
|
575 |
| -@cbook.deprecated("2.2") |
576 |
| -class AxisMenu(object): |
577 |
| - def __init__(self, master, naxes): |
578 |
| - self._master = master |
579 |
| - self._naxes = naxes |
580 |
| - self._mbar = Tk.Frame(master=master, relief=Tk.RAISED, borderwidth=2) |
581 |
| - self._mbar.pack(side=Tk.LEFT) |
582 |
| - self._mbutton = Tk.Menubutton( |
583 |
| - master=self._mbar, text="Axes", underline=0) |
584 |
| - self._mbutton.pack(side=Tk.LEFT, padx="2m") |
585 |
| - self._mbutton.menu = Tk.Menu(self._mbutton) |
586 |
| - self._mbutton.menu.add_command( |
587 |
| - label="Select All", command=self.select_all) |
588 |
| - self._mbutton.menu.add_command( |
589 |
| - label="Invert All", command=self.invert_all) |
590 |
| - self._axis_var = [] |
591 |
| - self._checkbutton = [] |
592 |
| - for i in range(naxes): |
593 |
| - self._axis_var.append(Tk.IntVar()) |
594 |
| - self._axis_var[i].set(1) |
595 |
| - self._checkbutton.append(self._mbutton.menu.add_checkbutton( |
596 |
| - label = "Axis %d" % (i+1), |
597 |
| - variable=self._axis_var[i], |
598 |
| - command=self.set_active)) |
599 |
| - self._mbutton.menu.invoke(self._mbutton.menu.index("Select All")) |
600 |
| - self._mbutton['menu'] = self._mbutton.menu |
601 |
| - self._mbar.tk_menuBar(self._mbutton) |
602 |
| - self.set_active() |
603 |
| - |
604 |
| - def adjust(self, naxes): |
605 |
| - if self._naxes < naxes: |
606 |
| - for i in range(self._naxes, naxes): |
607 |
| - self._axis_var.append(Tk.IntVar()) |
608 |
| - self._axis_var[i].set(1) |
609 |
| - self._checkbutton.append( self._mbutton.menu.add_checkbutton( |
610 |
| - label = "Axis %d" % (i+1), |
611 |
| - variable=self._axis_var[i], |
612 |
| - command=self.set_active)) |
613 |
| - elif self._naxes > naxes: |
614 |
| - for i in range(self._naxes-1, naxes-1, -1): |
615 |
| - del self._axis_var[i] |
616 |
| - self._mbutton.menu.forget(self._checkbutton[i]) |
617 |
| - del self._checkbutton[i] |
618 |
| - self._naxes = naxes |
619 |
| - self.set_active() |
620 |
| - |
621 |
| - def get_indices(self): |
622 |
| - a = [i for i in range(len(self._axis_var)) if self._axis_var[i].get()] |
623 |
| - return a |
624 |
| - |
625 |
| - def set_active(self): |
626 |
| - self._master.set_active(self.get_indices()) |
627 |
| - |
628 |
| - def invert_all(self): |
629 |
| - for a in self._axis_var: |
630 |
| - a.set(not a.get()) |
631 |
| - self.set_active() |
632 |
| - |
633 |
| - def select_all(self): |
634 |
| - for a in self._axis_var: |
635 |
| - a.set(1) |
636 |
| - self.set_active() |
637 |
| - |
638 |
| - |
639 | 557 | class NavigationToolbar2Tk(NavigationToolbar2, Tk.Frame):
|
640 | 558 | """
|
641 | 559 | Attributes
|
|
0 commit comments