get_layout

Maps.get_layout(filepath=None, override=False, precision=5)

Get the positions of all axes within the current plot.

To re-apply a layout, use:

>>> l = m.get_layout()
>>> m.set_layout(l)

Note

The returned list is only a snapshot of the current layout. It can only be re-applied to a given figure if the order at which the axes are created remains the same!

Parameters:
  • filepath (str or pathlib.Path, optional) –

    If provided, a json-file will be created at the specified destination that can be used in conjunction with m.set_layout(…) to apply the layout:

    >>> m.get_layout(filepath=<FILEPATH>, override=True)
    >>> m.apply_layout_layout(<FILEPATH>)
    

    You can also manually read-in the layout-dict via: >>> import json >>> layout = json.load(<FILEPATH>)

  • override (bool) – Indicator if the file specified as β€˜filepath’ should be overwritten if it already exists. The default is False.

  • precision (int or None) – The precision of the returned floating-point numbers. If None, all available digits are returned The default is 5

Returns:

layout – A dict of the positons of all axes, e.g.: {1:(x0, y0, width height), …}

Return type:

dict or None