diff options
author | Rémi Flamary <remi.flamary@gmail.com> | 2020-04-20 15:19:09 +0200 |
---|---|---|
committer | Rémi Flamary <remi.flamary@gmail.com> | 2020-04-20 15:19:09 +0200 |
commit | e65606ae498bd611f6a994868c2a66dfbea403cd (patch) | |
tree | b9b43dcaf8499b6d57b806ce04350fb6b792537f /docs/source/auto_examples/plot_free_support_barycenter.rst | |
parent | 8acaf262baa04a4d2bdd9c774c45c5bb2fb2d12a (diff) |
big update examples
Diffstat (limited to 'docs/source/auto_examples/plot_free_support_barycenter.rst')
-rw-r--r-- | docs/source/auto_examples/plot_free_support_barycenter.rst | 52 |
1 files changed, 37 insertions, 15 deletions
diff --git a/docs/source/auto_examples/plot_free_support_barycenter.rst b/docs/source/auto_examples/plot_free_support_barycenter.rst index d1b3b80..f349604 100644 --- a/docs/source/auto_examples/plot_free_support_barycenter.rst +++ b/docs/source/auto_examples/plot_free_support_barycenter.rst @@ -1,6 +1,12 @@ +.. only:: html + + .. note:: + :class: sphx-glr-download-link-note + Click :ref:`here <sphx_glr_download_auto_examples_plot_free_support_barycenter.py>` to download the full example code + .. rst-class:: sphx-glr-example-title -.. _sphx_glr_auto_examples_plot_free_support_barycenter.py: + .. _sphx_glr_auto_examples_plot_free_support_barycenter.py: ==================================================== @@ -12,8 +18,7 @@ sum of diracs. - -.. code-block:: python +.. code-block:: default # Author: Vivien Seguy <vivien.seguy@iip.ist.i.kyoto-u.ac.jp> @@ -31,13 +36,13 @@ sum of diracs. + Generate data ------------- %% parameters and data generation - -.. code-block:: python +.. code-block:: default N = 3 d = 2 @@ -67,12 +72,12 @@ Generate data + Compute free support barycenter ------------- - -.. code-block:: python +.. code-block:: default k = 10 # number of Diracs of the barycenter @@ -88,18 +93,18 @@ Compute free support barycenter + Plot data --------- - -.. code-block:: python +.. code-block:: default pl.figure(1) for (x_i, b_i) in zip(measures_locations, measures_weights): color = np.random.randint(low=1, high=10 * N) - pl.scatter(x_i[:, 0], x_i[:, 1], s=b * 1000, label='input measure') + pl.scatter(x_i[:, 0], x_i[:, 1], s=b_i * 1000, label='input measure') pl.scatter(X[:, 0], X[:, 1], s=b * 1000, c='black', marker='^', label='2-Wasserstein barycenter') pl.title('Data measures and their barycenter') pl.legend(loc=0) @@ -108,27 +113,44 @@ Plot data .. image:: /auto_examples/images/sphx_glr_plot_free_support_barycenter_001.png - :align: center + :class: sphx-glr-single-img +.. rst-class:: sphx-glr-script-out + Out: -**Total running time of the script:** ( 0 minutes 0.129 seconds) + .. code-block:: none + /home/rflamary/PYTHON/POT/examples/plot_free_support_barycenter.py:69: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. + pl.show() + + + + + +.. rst-class:: sphx-glr-timing + + **Total running time of the script:** ( 0 minutes 0.080 seconds) + + +.. _sphx_glr_download_auto_examples_plot_free_support_barycenter.py: .. only :: html .. container:: sphx-glr-footer + :class: sphx-glr-footer-example + - .. container:: sphx-glr-download + .. container:: sphx-glr-download sphx-glr-download-python :download:`Download Python source code: plot_free_support_barycenter.py <plot_free_support_barycenter.py>` - .. container:: sphx-glr-download + .. container:: sphx-glr-download sphx-glr-download-jupyter :download:`Download Jupyter notebook: plot_free_support_barycenter.ipynb <plot_free_support_barycenter.ipynb>` @@ -137,4 +159,4 @@ Plot data .. rst-class:: sphx-glr-signature - `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.readthedocs.io>`_ + `Gallery generated by Sphinx-Gallery <https://sphinx-gallery.github.io>`_ |