.. 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 :ref:`Go to the end ` 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-16 .. code-block:: Python 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 [1545, 774, 750, 450] .. GENERATED FROM PYTHON SOURCE LINES 18-21 Frame of figure window is the entire window including any title bar and window frame. properties: ``frameGeometry, x, y`` .. GENERATED FROM PYTHON SOURCE LINES 21-25 .. code-block:: Python 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): [1544, 743, 752, 482] figure position (x,y): [1544, 743] x, y: 1544 743 .. GENERATED FROM PYTHON SOURCE LINES 26-27 The real plot area of the figure is accessible by ``geometry``, ``size``, ``width``, ``height``. .. GENERATED FROM PYTHON SOURCE LINES 27-32 .. code-block:: Python 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): [1545, 774, 750, 450] figure size (w,h): [750, 450] figure width: 750 figure height: 450 .. GENERATED FROM PYTHON SOURCE LINES 33-34 In order to change the outer position use the property ``pos``. .. GENERATED FROM PYTHON SOURCE LINES 34-36 .. code-block:: Python fig["pos"] = (0, 0) .. GENERATED FROM PYTHON SOURCE LINES 37-38 Size change: property ``size``. .. GENERATED FROM PYTHON SOURCE LINES 38-40 .. code-block:: Python fig["size"] = (500, 400) .. GENERATED FROM PYTHON SOURCE LINES 41-42 In order to change the inner position and size use the property ``geometry``. .. GENERATED FROM PYTHON SOURCE LINES 42-43 .. code-block:: Python fig["geometry"] = (100, 200, 300, 200) .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.063 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-jupyter :download:`Download Jupyter notebook: demo_figurePositioning.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: demo_figurePositioning.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: demo_figurePositioning.zip `