class_docstr: Space in the figure for artists above the panels
  
  Ordered from the edge of the figure and going inwards
class_docstr_tok: ["Space","in","the","figure","for","artists","above","the","panels","Ordered","from","the","edge","of","the","figure","and","going","inwards"]
code: def _calculate(self):
      pack = self.pack
      _property = self.pack.theme.themeables.property
      W, H = _property("figure_size")
      F = W / H
  
      self.plot_margin = _property("plot_margin_top")
      if pack.plot_title:
          self.plot_title = bbox_in_figure_space(
              pack.plot_title, pack.figure, pack.renderer
          ).height
          self.plot_title_margin_bottom = (
              _property("plot_title", "margin").get_as("b", "fig") * F
          )
  
      if pack.plot_subtitle:
          self.plot_subtitle = bbox_in_figure_space(
              pack.plot_subtitle, pack.figure, pack.renderer
          ).height
          self.plot_subtitle_margin_bottom = (
              _property("plot_subtitle", "margin").get_as("b", "fig")
              * F
          )
  
      if pack.legend and pack.legend_position == "top":
          self.legend = bbox_in_figure_space(
              pack.legend, pack.figure, pack.renderer
          ).height
          self.legend_box_spacing = _property("legend_box_spacing") * F
  
      top_strips = get_top_strip_boxpatches_in_first_row(pack.axs)
      self.top_strip_height = max_height(pack, top_strips)
  
imports: from __future__ import annotations
  import typing
  from abc import ABC
  from dataclasses import dataclass, fields
  from itertools import chain
  from matplotlib._tight_layout import get_subplotspec_list
  from ..facets import facet_grid, facet_null, facet_wrap
  from .patches import SFancyBboxPatch
  from .utils import bbox_in_figure_space, tight_bbox_in_figure_space
label_desc: Use image node_id 1 for calling the top_spaces obj's underlying member method code with example usage: obj._calculate() without return types