code: def resize(self, width, height):
      # Size from macOS is logical pixels, dpi is physical.
      scale = self.figure.dpi / self.device_pixel_ratio
      width /= scale
      height /= scale
      self.figure.set_size_inches(width, height, forward=False)
      ResizeEvent("resize_event", self)._process()
      self.draw_idle()
  
imports: import os
  import matplotlib
  from matplotlib import _api, cbook
  from matplotlib._pylab_helpers import Gcf
  from .None import _macosx
  from .backend_agg import FigureCanvasAgg
  from matplotlib.backend_bases import _Backend, FigureCanvasBase, FigureManagerBase, NavigationToolbar2, ResizeEvent, TimerBase, _allow_interrupt
label_desc: Use image node_id 7 for calling the FigureCanvasMac obj's underlying member method code with example usage: obj.resize(width, height) without return types