Tile Figures#

Curtesy of https://stackoverflow.com/questions/61503168/how-to-tile-matplotlib-figures-evenly-on-screen

get_monitors()[source]#
screen_geometry(monitor=0)[source]#

Query the screen geometry using the screeninfo module

Parameters:

monitor (int) – The monitor index to query. Defaults to 0.

Return type:

Tuple[int, ...]

Returns:

A 4-tuple (x, y, w, h) specifying the geometry of the screen area.

set_figure_geometry(fig, backend, x, y, w, h)[source]#
Return type:

None

tile_figures(cols=3, rows=2, screen_rect=None, tile_offsets=None)[source]#

Tile figures. If more than cols*rows figures are present, cols and rows are adjusted. For now, a Qt- or Tk-backend is required.

import matplotlib matplotlib.use(‘Qt5Agg’) matplotlib.use(‘TkAgg’)

Parameters:
  • cols – Number of cols, rows shown. Will be adjusted if the number of figures is larger than cols*rows.

  • rows – Number of cols, rows shown. Will be adjusted if the number of figures is larger than cols*rows.

  • screen_rect – A 4-tuple specifying the geometry (x,y,w,h) of the screen area used for tiling (in pixels). If None, the system’s screen is queried using the screeninfo module.

  • tile_offsets – A 2-tuple specifying the offsets in x- and y- direction. Can be used to compensate the title bar height.

Return type:

None