diff --git a/docs/sources/CHANGELOG.md b/docs/sources/CHANGELOG.md index 1b1cee0b2..c9681eb9f 100755 --- a/docs/sources/CHANGELOG.md +++ b/docs/sources/CHANGELOG.md @@ -25,6 +25,8 @@ The CHANGELOG for the current development version is available at ##### Bug Fixes +- Fix unreadable labels in `plot_confusion_matrix` for imbalanced datasets if `show_absolute=True` and `show_normed=True`. ([#504](https://github.com/rasbt/mlxtend/pull/504)) + - Raises a more informative error if a `SparseDataFrame` is passed to `apriori` and the dataframe has integer column names that don't start with `0` due to current limitations of the `SparseDataFrame` implementation in pandas. ([#503](https://github.com/rasbt/mlxtend/pull/503)) ### Version 0.15.0 (01-19-2019) diff --git a/mlxtend/plotting/plot_confusion_matrix.py b/mlxtend/plotting/plot_confusion_matrix.py index 762b8dc73..ec70f8e8a 100644 --- a/mlxtend/plotting/plot_confusion_matrix.py +++ b/mlxtend/plotting/plot_confusion_matrix.py @@ -66,10 +66,10 @@ def plot_confusion_matrix(conf_mat, if figsize is None: figsize = (len(conf_mat)*1.25, len(conf_mat)*1.25) - if show_absolute: - matshow = ax.matshow(conf_mat, cmap=cmap) - else: + if show_normed: matshow = ax.matshow(normed_conf_mat, cmap=cmap) + else: + matshow = ax.matshow(conf_mat, cmap=cmap) if colorbar: fig.colorbar(matshow)