.. DO NOT EDIT. .. THIS FILE WAS AUTOMATICALLY GENERATED BY SPHINX-GALLERY. .. TO MAKE CHANGES, EDIT THE SOURCE PYTHON FILE: .. "_gallery/controllers/specify_names.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_controllers_specify_names.py: Specify IDs with subplot names ============================== Provide a list of tuples where each tuple has subplot names. The same controller will be used for the subplots indicated by each of these tuples .. GENERATED FROM PYTHON SOURCE LINES 8-47 .. image-sg:: /_gallery/controllers/images/sphx_glr_specify_names_001.webp :alt: specify names :srcset: /_gallery/controllers/images/sphx_glr_specify_names_001.webp :class: sphx-glr-single-img .. rst-class:: sphx-glr-script-out .. code-block:: none /home/runner/work/fastplotlib/fastplotlib/fastplotlib/graphics/features/_base.py:18: UserWarning: casting float64 array to float32 warn(f"casting {array.dtype} array to float32") | .. code-block:: Python # test_example = false import numpy as np import fastplotlib as fpl xs = np.linspace(0, 2 * np.pi, 100) ys = np.sin(xs) # create some subplots names names = ["subplot_0", "subplot_1", "subplot_2", "subplot_3", "subplot_4", "subplot_5"] # list of tuples of subplot names # subplots within each tuple will use the same controller. ids = [ ("subplot_0", "subplot_3"), ("subplot_1", "subplot_2", "subplot_4"), ] figure = fpl.Figure( shape=(2, 3), controller_ids=ids, names=names, size=(700, 560), ) for subplot in figure: subplot.add_line(np.column_stack([xs, ys + np.random.normal(scale=0.1, size=100)])) figure.show(maintain_aspect=False) # 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() .. rst-class:: sphx-glr-timing **Total running time of the script:** (0 minutes 0.982 seconds) .. _sphx_glr_download__gallery_controllers_specify_names.py: .. only:: html .. container:: sphx-glr-footer sphx-glr-footer-example .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: specify_names.ipynb ` .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: specify_names.py ` .. container:: sphx-glr-download sphx-glr-download-zip :download:`Download zipped: specify_names.zip ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_