bluemira.display.auto_config
Automatic configuration some plot defaults
Functions
|
Get the size in pixels of the primary screen. |
Direct run of screen size check without subprocess |
|
|
Scale figure size to fit on small screens. |
|
Set a series of plotting defaults based on machine and user. |
Module Contents
- bluemira.display.auto_config.get_primary_screen_size(timeout: float = 3)
Get the size in pixels of the primary screen.
Used for sizing figures to the screen for small screens.
- Parameters:
timeout (float) – timeout value in seconds
- Returns:
width (Union[int, None]) – width of the primary screen in pixels. If there is no screen returns None
height (Union[int, None]) – height of the primary screen in pixels. If there is no screen returns None
- bluemira.display.auto_config._get_primary_screen_size()
Direct run of screen size check without subprocess
- Returns:
width – width of the primary screen in pixels. If there is no screen returns None
height – height of the primary screen in pixels. If there is no screen returns None
- bluemira.display.auto_config.get_figure_scale_factor(figsize)
Scale figure size to fit on small screens.
If the screen fits the figure the scale factor is 1.
- Parameters:
figsize (np.array(float, float)) – matplotlib figsize width x height
- Returns:
sf – scale factor to fit screen
- Return type:
float
- bluemira.display.auto_config.plot_defaults(*, force=False)
Set a series of plotting defaults based on machine and user.
If bluemira plots are not to your tastes, do not work with your OS, or don’t fit your screen, please create a user profile for yourself/machine here and adjust settings as needed.
- Parameters:
force (bool) – force default figsize irrespective of screen size