From 7ce44706461aa49958a9d9de52391905cf5531e9 Mon Sep 17 00:00:00 2001 From: mathurinm Date: Wed, 1 Mar 2017 16:32:18 +0100 Subject: [PATCH] Correct figure number + matplotlib 2 --- doc/modules/mixture.rst | 2 +- examples/mixture/plot_concentration_prior.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/modules/mixture.rst b/doc/modules/mixture.rst index e8f68879f21a7..2b1e403470d5b 100644 --- a/doc/modules/mixture.rst +++ b/doc/modules/mixture.rst @@ -188,7 +188,7 @@ more uniform weights when the type of prior is 'dirichlet_distribution' while this is not necessarily the case for the 'dirichlet_process' type (used by default). -.. |plot_bgmm| image:: ../auto_examples/mixture/images/sphx_glr_plot_concentration_prior_002.png +.. |plot_bgmm| image:: ../auto_examples/mixture/images/sphx_glr_plot_concentration_prior_001.png :target: ../auto_examples/mixture/plot_concentration_prior.html :scale: 48% diff --git a/examples/mixture/plot_concentration_prior.py b/examples/mixture/plot_concentration_prior.py index 49d9e6211b351..b51ad2280b65f 100644 --- a/examples/mixture/plot_concentration_prior.py +++ b/examples/mixture/plot_concentration_prior.py @@ -70,7 +70,8 @@ def plot_results(ax1, ax2, estimator, X, y, title, plot_title=False): ax2.get_xaxis().set_tick_params(direction='out') ax2.yaxis.grid(True, alpha=0.7) for k, w in enumerate(estimator.weights_): - ax2.bar(k - .45, w, width=0.9, color='#56B4E9', zorder=3) + ax2.bar(k, w, width=0.9, color='#56B4E9', zorder=3, + align='center') ax2.text(k, w + 0.007, "%.1f%%" % (w * 100.), horizontalalignment='center') ax2.set_xlim(-.6, 2 * n_components - .4)