8000 Add plot titles and newstyle plt import in OLS vs Ridge example · Felixhawk/scikit-learn@7430eba · GitHub
[go: up one dir, main page]

Skip to content

Commit 7430eba

Browse files
committed
Add plot titles and newstyle plt import in OLS vs Ridge example
1 parent d43a767 commit 7430eba

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

examples/linear_model/plot_ols_ridge_variance.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030

3131
import numpy as np
32-
import pylab as pl
32+
import matplotlib.pyplot as plt
3333

3434
from sklearn import linear_model
3535

@@ -44,9 +44,10 @@
4444

4545
fignum = 1
4646
for name, clf in classifiers.iteritems():
47-
fig = pl.figure(fignum, figsize=(4, 3))
48-
pl.clf()
49-
ax = pl.axes([.12, .12, .8, .8])
47+
fig = plt.figure(fignum, figsize=(4, 3))
48+
plt.clf()
49+
plt.title(name)
50+
ax = plt.axes([.12, .12, .8, .8])
5051

5152
for _ in range(6):
5253
this_X = .1 * np.random.normal(size=(2, 1)) + X_train
@@ -67,4 +68,4 @@
6768
ax.set_xlim(0, 2)
6869
fignum += 1
6970

70-
pl.show()
71+
plt.show()

0 commit comments

Comments
 (0)
0