  from matplotlib.figure import Figure  # noqa
  from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,  # noqa
                                                 NavigationToolbar2Tk)
  
  from .custom_widgets import Tooltip  # noqa
  from .utils import get_config, get_images, LongRunningTask  # noqa
  
  logger = logging.getLogger(__name__)  # pylint: disable=invalid-name
  
  
  class NavigationToolbar(NavigationToolbar2Tk):  # pylint: disable=too-many-ancestors
      """ Same as default, but only including buttons we need
          with custom icons and layout
          From: https://stackoverflow.com/questions/12695678 """
      toolitems = [t for t in NavigationToolbar2Tk.toolitems if
                   t[0] in ("Home", "Pan", "Zoom", "Save")]
  
      @staticmethod
      def _Button(frame, text, file, command, extension=".gif"):  # pylint: disable=arguments-differ
          """ Map Buttons to their own frame.
              Use custom button icons, Use ttk buttons pack to the right """
          iconmapping = {"home": "reload",
                         "filesave": "save",
                         "zoom_to_rect": "zoom"}
          icon = iconmapping[file] if iconmapping.get(file, None) else file
          img = get_images().icons[icon]
          btn = ttk.Button(frame, text=text, image=img, command=command)
          btn.pack(side=tk.RIGHT, padx=2)
          return btn
  
      def _init_toolbar(self):
          """ Same as original but ttk widgets and standard tool-tips used. Separator added and
              message label packed to the left """
          xmin, xmax = self.canvas.figure.bbox.intervalx
          height, width = 50, xmax-xmin
          ttk.Frame.__init__(self, master=self.window, width=int(width), height=int(height))
  
          sep = ttk.Frame(self, height=2, relief=tk.RIDGE)
          sep.pack(fill=tk.X, pady=(5, 0), side=tk.TOP)
  
          self.update()  # Make axes menu
  
          btnframe = ttk.Frame(self)
          btnframe.pack(fill=tk.X, padx=5, pady=5, side=tk.RIGHT)
  
          for text, tooltip_text, image_file, callback in self.toolitems:
              if text is None:
                  # Add a spacer; return value is unused.
                  self._Spacer()
 
</s> remove # pylint: disable=wrong-import-position
matplotlib.use("TkAgg")

from matplotlib import style  # noqa
from matplotlib.figure import Figure  # noqa
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,  # noqa
 </s> add from matplotlib import style
from matplotlib.figure import Figure
from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg, </s> remove         for text, tooltip_text, image_file, callback in self.toolitems:
            if text is None:
                # Add a spacer; return value is unused.
                self._Spacer()
            else:
                button = self._Button(btnframe, text=text, file=image_file,
                                      command=getattr(self, callback))
                if tooltip_text is not None:
                    Tooltip(button, text=tooltip_text, wrap_length=200)
 </s> add matplotlib.use("TkAgg") </s> remove     def refresh(self, *args):  # pylint: disable=unused-argument
        """ Read loss data and apply to graph """
 </s> add     def refresh(self, *args) -> None:  # pylint: disable=unused-argument
        """ Read the latest loss data and apply to current graph """ </s> remove         if not refresh_var.get() and self.thread is None:
 </s> add         if not refresh_var.get() and self._thread is None:
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
  from matplotlib.figure import Figure  # noqa
  from matplotlib.backends.backend_tkagg import (FigureCanvasTkAgg,  # noqa
                                                 NavigationToolbar2Tk)
  
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
from .custom_widgets import Tooltip
from .utils import get_config, get_images, LongRunningTask
  
          for text, tooltip_text, image_file, callback in self.toolitems:
              if text is None:
                  # Add a spacer; return value is unused.
                  self._Spacer()
keep keep keep keep replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace replace keep keep keep keep keep
 Update matplotlib requirement
  - bump min requirement to 3.5.1
  - Fix custom toolbar for v3.5.1
  - Documentation + linting 
lib/gui/display_graph.py