
.. DO NOT EDIT.
.. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY.
.. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE:
.. "gallery/scene/grid_layout/grid_holed.py"
.. LINE NUMBERS ARE GIVEN BELOW.

.. only:: html

    .. note::
        :class: sphx-glr-download-link-note

        :ref:`Go to the end <sphx_glr_download_gallery_scene_grid_layout_grid_holed.py>`
        to download the full example code.

.. rst-class:: sphx-glr-example-title

.. _sphx_glr_gallery_scene_grid_layout_grid_holed.py:


More complex grid layout
========================

::

    +---+-------+---+
    | 1 |   1   | 2 |
    |---+-------+---+
    | 3 | Empty | 2 |
    +---+-------+---+
    | 3 |   4   | 4 |
    +---+-------+---+

.. GENERATED FROM PYTHON SOURCE LINES 22-50



.. image-sg:: /gallery/scene/grid_layout/images/sphx_glr_grid_holed_001.png
   :alt: grid holed
   :srcset: /gallery/scene/grid_layout/images/sphx_glr_grid_holed_001.png
   :class: sphx-glr-single-img





.. code-block:: Python


    import sys

    from vispy import scene, app

    canvas = scene.SceneCanvas(keys='interactive')
    canvas.size = 600, 600
    canvas.bgcolor = "#000000"
    canvas.show()

    grid = canvas.central_widget.add_grid()

    # top_left
    grid.add_widget(row=0, col=0, col_span=2, bgcolor="#ffffff")

    # top_right
    grid.add_widget(row=0, col=2, row_span=2, bgcolor="#dddddd")

    # bottom_left
    grid.add_widget(row=1, col=0, row_span=2, bgcolor="#444444")


    # bottom_right
    grid.add_widget(row=2, col=1, col_span=2, bgcolor="#888888")


    if __name__ == '__main__' and sys.flags.interactive == 0:
        app.run()


.. rst-class:: sphx-glr-timing

   **Total running time of the script:** (0 minutes 0.452 seconds)


.. _sphx_glr_download_gallery_scene_grid_layout_grid_holed.py:

.. only:: html

  .. container:: sphx-glr-footer sphx-glr-footer-example

    .. container:: sphx-glr-download sphx-glr-download-jupyter

      :download:`Download Jupyter notebook: grid_holed.ipynb <grid_holed.ipynb>`

    .. container:: sphx-glr-download sphx-glr-download-python

      :download:`Download Python source code: grid_holed.py <grid_holed.py>`

    .. container:: sphx-glr-download sphx-glr-download-zip

      :download:`Download zipped: grid_holed.zip <grid_holed.zip>`


.. only:: html

 .. rst-class:: sphx-glr-signature

    `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_
