summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authoreloitanguy <69361683+eloitanguy@users.noreply.github.com>2022-05-11 08:57:54 +0200
committerGitHub <noreply@github.com>2022-05-11 08:57:54 +0200
commitd6bf10d8502b1c69f58f009b16634a110053eca1 (patch)
tree8d74efb46fa79063f7c2285f1d99c41b5b2b9ac3 /examples
parentc1ccfc45350f8db3fa78d91b84eb4286bcf36e69 (diff)
[WIP] Graphical tweaks for GWB + fixed seed method for the partial gromov test (#376)
* GWB first solver version * tests + example for gwb (untested) + free_bar doc fix * improved doc, fixed minor bugs, better example visu * minor doc + visu fixes * plot GWB pep8 fix * fixed partial gromov test reproductibility * added an animation for the GWB visu * added PR num * minor doc fixes + better gwb logo * GWB graphical tweaks + better seed method for partial gromov test * fixed PR number * refixed seed issue * seed fix fix fix Co-authored-by: RĂ©mi Flamary <remi.flamary@gmail.com>
Diffstat (limited to 'examples')
-rw-r--r--examples/barycenters/plot_generalized_free_support_barycenter.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/barycenters/plot_generalized_free_support_barycenter.py b/examples/barycenters/plot_generalized_free_support_barycenter.py
index 9af1953..e685ec7 100644
--- a/examples/barycenters/plot_generalized_free_support_barycenter.py
+++ b/examples/barycenters/plot_generalized_free_support_barycenter.py
@@ -33,8 +33,8 @@ import matplotlib.animation as animation
# Input measures
sub_sample_factor = 8
I1 = pl.imread('../../data/redcross.png').astype(np.float64)[::sub_sample_factor, ::sub_sample_factor, 2]
-I2 = pl.imread('../../data/tooth.png').astype(np.float64)[::sub_sample_factor, ::sub_sample_factor, 2]
-I3 = pl.imread('../../data/heart.png').astype(np.float64)[::sub_sample_factor, ::sub_sample_factor, 2]
+I2 = pl.imread('../../data/tooth.png').astype(np.float64)[::-sub_sample_factor, ::sub_sample_factor, 2]
+I3 = pl.imread('../../data/heart.png').astype(np.float64)[::-sub_sample_factor, ::sub_sample_factor, 2]
sz = I1.shape[0]
UU, VV = np.meshgrid(np.arange(sz), np.arange(sz))
@@ -145,8 +145,11 @@ def _init():
def _update_plot(i):
- ax.view_init(elev=i, azim=4 * i)
+ if i < 45:
+ ax.view_init(elev=0, azim=4 * i)
+ else:
+ ax.view_init(elev=i - 45, azim=4 * i)
return fig,
-ani = animation.FuncAnimation(fig, _update_plot, init_func=_init, frames=90, interval=50, blit=True, repeat_delay=2000)
+ani = animation.FuncAnimation(fig, _update_plot, init_func=_init, frames=136, interval=50, blit=True, repeat_delay=2000)