Skip to content

Commit

Permalink
support axes in plot_decision_regions
Browse files Browse the repository at this point in the history
  • Loading branch information
rasbt committed May 7, 2017
1 parent 0d1643c commit 1ddaea8
Show file tree
Hide file tree
Showing 11 changed files with 72 additions and 26 deletions.
1 change: 1 addition & 0 deletions docs/sources/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ The CHANGELOG for the current development version is available at
##### Bug Fixes

- `SequentialFeatureSelector` now correctly accepts a `None` argument for the `scoring` parameter to infer the default scoring metric from scikit-learn classifiers and regressors.
- The `plot_decision_regions` function now supports pre-existing axes objects generated via matplotlib's `plt.subplots`. ([See example](http://rasbt.github.io/mlxtend/user_guide/plotting/plot_decision_regions/#example-6-working-with-existing-axes-objects-using-subplots))


### Version 0.6.0 (2017-03-18)
Expand Down
86 changes: 69 additions & 17 deletions docs/sources/user_guide/plotting/plot_decision_regions.ipynb

Large diffs are not rendered by default.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions mlxtend/plotting/decision_regions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from itertools import cycle
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.colors import ListedColormap


def plot_decision_regions(X, y, clf,
Expand Down Expand Up @@ -147,14 +146,8 @@ def plot_decision_regions(X, y, clf,
ax.axes.get_yaxis().set_ticks([])

if legend:
legend = plt.legend(loc=legend,
fancybox=True,
framealpha=0.3,
scatterpoints=1,
handletextpad=-0.25,
borderaxespad=0.9)

ax.add_artist(legend)
handles, labels = ax.get_legend_handles_labels()
ax.legend(handles, labels, framealpha=0.3, scatterpoints=1, loc=legend)

if plot_testdata:
if dim == '2d':
Expand Down

0 comments on commit 1ddaea8

Please sign in to comment.