code: def autosize(savefile="box_gates_autosized.png"):
      drawer = MPLDrawer(n_layers=4, n_wires=2)
  
      drawer.box_gate(layer=0, wires=0, text="A longer label")
      drawer.box_gate(layer=0, wires=1, text="Label")
  
      drawer.box_gate(
          layer=1, wires=(0, 1), text="long multigate label"
      )
  
      drawer.box_gate(
          layer=3,
          wires=(0, 1),
          text="Not autosized label",
          autosize=False,
      )
  
      plt.savefig(folder / savefile)
      plt.close()
  
file_path: pennylane/doc/_static/drawer/mpldrawer_examples.py
imports: import pathlib
  import matplotlib.pyplot
  from pennylane.drawer import MPLDrawer
  from pennylane.drawer.style import _set_style
label_desc: Use image node_id 5 for calling a global function with example usage: autosize(savefile) without return types