.. _sphx_glr_auto_examples_plot_legend.py: ============================= Generating a legend ============================= An example of how to use the `legend` kwarg to generate a legend. .. image:: /auto_examples/images/sphx_glr_plot_legend_001.png :align: center .. code-block:: python # Code source: Andrew Heusser # License: MIT # import import hypertools as hyp # load example data geo = hyp.load('weights_sample') # plot geo.plot(fmt='.', legend=['Group A', 'Group B', 'Group C']) **Total running time of the script:** ( 0 minutes 0.088 seconds) .. only :: html .. container:: sphx-glr-footer .. container:: sphx-glr-download :download:`Download Python source code: plot_legend.py ` .. container:: sphx-glr-download :download:`Download Jupyter notebook: plot_legend.ipynb ` .. only:: html .. rst-class:: sphx-glr-signature `Gallery generated by Sphinx-Gallery `_