项目作者: NorthGuard

项目描述 :
figure_manager can snap matplotlib-figures to various positions on the screen.
高级语言: Python
项目地址: git://github.com/NorthGuard/figure_manager.git
创建时间: 2017-06-02T07:47:38Z
项目社区:https://github.com/NorthGuard/figure_manager

开源协议:MIT License

下载


figure_manager

figure_manager can snap matplotlib-figures to various positions on the screen.
For example, more one figure to upper-left corner of the screen or make a figure full-screen.

Example

The figure manager is used as follows:

  1. import matplotlib.pyplot as plt
  2. import numpy as np
  3. from figure_manager import get_figure_manager
  4. # Get figure-manager
  5. figm = get_figure_manager() # Here the figure manager measures the screen
  6. # Make a figure
  7. plt.figure()
  8. xs = np.linspace(0, 6, 200)
  9. ys = np.sin(xs)
  10. plt.plot(xs, ys)
  11. plt.show()
  12. # Split screen into a 2-by-2 grid and move figure to upper-left corner
  13. figm.split_2x2.ul()

When the figure-manager is initialized it creates a test-figure, which is then maximized, used to
measure the size of the screen and closed (takes a fraction of a second).

Installation

Install by pip install figure-manager

More Usage

Full-screen figure:

  1. figm.full()

Left or right side of screen:

  1. figm.l()
  2. figm.r()

2-by-2 split of screen. Upper-left, upper-right, bottom-left and bottom-right:

  1. figm.split_2x2.ul()
  2. figm.split_2x2.ur()
  3. figm.split_2x2.bl()
  4. figm.split_2x2.br()

3-by-2 split of screen. Upper-left, middle-left, bottom-left, upper-right, middle-right and bottom-right:

  1. figm.split_3x2.ul()
  2. figm.split_3x2.ml()
  3. figm.split_3x2.bl()
  4. figm.split_3x2.ur()
  5. figm.split_3x2.mr()
  6. figm.split_3x2.br()

3-by-1 split of screen. Upper, middle and bottom:

  1. figm.split_3x1.u()
  2. figm.split_3x1.m()
  3. figm.split_3x1.b()

Custom grid and position

  1. figm.position(n_rows=8, n_cols=3, row_nr=1, col_nr=2)

Test Script

The example.py further exemplifies the use.

Screenshots of grid

Full screen

Full-screen figure.

Left and right

Left and right figure.

2-by-2 figures

2-by-2 figure grid.

3-by-2 figures

3-by-2 figure grid.

3-by-1 figures

3-by-1 figure grid.