.. _sphx_glr_auto_examples_plot_group.py: group ===== Group Beampy modules to place them easily. Grouping modules allows to create complex layout in your slide. .. code-block:: python from beampy import * # Remove quiet=True to get Beampy render outputs doc = document(quiet=True) with slide('Grouping elements'): # Using with statement: with group(y=0.1, background='lightblue', width='90%') as g1: text("I'm inside the first group", y=0) text('Me too!', y="+0.1") # Create two groups (g2 and g4) aligned on top # and with automatic horizontal position with group(x='auto', y=0.3, width=400, height=200, background='lightgreen') as g2: text('At the group center', x='center', y='center') # Add child group to the parent group with group(width='50%', background='red', x=g2.left+0, y=g2.bottom+bottom(0)) as g3: text('A group in a group') with group(width='50%', background='violet', x=g3.right+0, y=g3.top+0) as g3: text('A group in a group') with group(x='auto', y=g2.top+0, height=300, width=300) as g4: text('''A last group with a bigger height and a lower width. The text inside this group has the group width!''') # Add a border to the last group g4.add_border() display_matplotlib(gcs()) .. image:: /auto_examples/images/sphx_glr_plot_group_001.png :align: center Module arguments ================ .. autoclass:: beampy.group :noindex: .. only :: html .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: plot_group.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_group.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_