.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/gridplot/gridplot_viewports_check.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note :ref:`Go to the end ` to download the full example code. .. rst-class:: sphx-glr-example-title .. _sphx_glr__gallery_gridplot_gridplot_viewports_check.py: GridPlot test viewport rects ============================ Test figure to test that viewport rects are positioned correctly .. GENERATED FROM PYTHON SOURCE LINES 7-37 .. code-block:: Python # test_example = true import fastplotlib as fpl import numpy as np figure = fpl.Figure( shape=(2, 3), size=(700, 560), names=list(map(str, range(6))) ) np.random.seed(0) a = np.random.rand(6, 10, 10) for data, subplot in zip(a, figure): subplot.add_image(data) subplot.docks["left"].size = 20 subplot.docks["right"].size = 30 subplot.docks["bottom"].size = 40 figure.show() # NOTE: `if __name__ == "__main__"` is NOT how to use fastplotlib interactively # please see our docs for using fastplotlib interactively in ipython and jupyter if __name__ == "__main__": print(__doc__) fpl.loop.run() .. _sphx_glr_download__gallery_gridplot_gridplot_viewports_check.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: gridplot_viewports_check.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: gridplot_viewports_check.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: gridplot_viewports_check.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_