.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "11_demos\itom\plots\demo_figurePositioning.py" .. LINE NUMBERS ARE GIVEN BELOW. .. only:: html .. note:: :class: sphx-glr-download-link-note Click :ref:`here ` to download the full example code .. rst-class:: sphx-glr-example-title .. _sphx_glr_11_demos_itom_plots_demo_figurePositioning.py: Figure positioning ======================= Demo for getting/setting the size and position of a figure. .. GENERATED FROM PYTHON SOURCE LINES 6-15 .. code-block:: default from itom import figure from itom import dataObject fig = figure() fig.plot(dataObject.randN([100, 200])) fig["geometry"] .. rst-class:: sphx-glr-script-out .. code-block:: none [585, 300, 750, 450] .. GENERATED FROM PYTHON SOURCE LINES 17-20 Frame of figure window is the entire window including any title bar and window frame. properties: ``frameGeometry, x, y`` .. GENERATED FROM PYTHON SOURCE LINES 20-24 .. code-block:: default print("figure frame geometry (x,y,w,h):", fig["frameGeometry"]) print("figure position (x,y):", fig["pos"]) print("x, y:", fig["x"], fig["y"]) .. rst-class:: sphx-glr-script-out .. code-block:: none figure frame geometry (x,y,w,h): [584, 277, 752, 474] figure position (x,y): [584, 277] x, y: 584 277 .. GENERATED FROM PYTHON SOURCE LINES 25-26 The real plot area of the figure is accessible by ``geometry``, ``size``, ``width``, ``height``. .. GENERATED FROM PYTHON SOURCE LINES 26-31 .. code-block:: default print("figure geometry (x,y,w,h):", fig["geometry"]) print("figure size (w,h):", fig["size"]) print("figure width:", fig["width"]) print("figure height:", fig["height"]) .. rst-class:: sphx-glr-script-out .. code-block:: none figure geometry (x,y,w,h): [585, 300, 750, 450] figure size (w,h): [750, 450] figure width: 750 figure height: 450 .. GENERATED FROM PYTHON SOURCE LINES 32-33 In order to change the outer position use the property ``pos``. .. GENERATED FROM PYTHON SOURCE LINES 33-35 .. code-block:: default fig["pos"] = (0, 0) .. GENERATED FROM PYTHON SOURCE LINES 36-37 Size change: property ``size``. .. GENERATED FROM PYTHON SOURCE LINES 37-39 .. code-block:: default fig["size"] = (500, 400) .. GENERATED FROM PYTHON SOURCE LINES 40-41 In order to change the inner position and size use the property ``geometry``. .. GENERATED FROM PYTHON SOURCE LINES 41-42 .. code-block:: default fig["geometry"] = (100, 200, 300, 200) .. rst-class:: sphx-glr-timing **Total running time of the script:** ( 0 minutes 0.165 seconds) .. _sphx_glr_download_11_demos_itom_plots_demo_figurePositioning.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_figurePositioning.py ` .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: demo_figurePositioning.ipynb `