Skip to content

Commit

Permalink
Merge pull request fastai#170 from aakashns/patch-1
Browse files Browse the repository at this point in the history
Allow setting figure size for confusion matrix
  • Loading branch information
jph00 authored Feb 23, 2018
2 parents 34ea07e + 1cb0bb6 commit 2cf6a1e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fastai/plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,13 @@ def plots_from_files(imspaths, figsize=(10,5), rows=1, titles=None, maintitle=No
plt.imshow(img)


def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues):
def plot_confusion_matrix(cm, classes, normalize=False, title='Confusion matrix', cmap=plt.cm.Blues, figsize=None):
"""
This function prints and plots the confusion matrix.
Normalization can be applied by setting `normalize=True`.
(This function is copied from the scikit docs.)
"""
plt.figure()
plt.figure(figsize=figsize)
plt.imshow(cm, interpolation='nearest', cmap=cmap)
plt.title(title)
plt.colorbar()
Expand Down

0 comments on commit 2cf6a1e

Please sign in to comment.