Want to plot few random dots and observe how SGD works

Tried this code:

import pandas as pd
from sklearn.linear_model import SGDClassifier
X1 = {“xcoord1”:pd.Series([0,0,1,1]),“ycoord2”:pd.Series([0,1,0,1])}
X3 = pd.DataFrame(X1)
y = [0, 1,1,1]
clf = SGDClassifier(loss=“hinge”, penalty=“l2”)
clf.fit(X3, y)

import numpy as np
import matplotlib.pyplot as plt
plt.plot(X3[0:1],‘bo’)
plt.plot(X3[1:],‘ro’)
a=np.linspace(0.,1.,num=11)
b=(-a*clf.coef_[0,0]-clf.intercept_[0])/clf.coef_[0,1]
plt.plot(a,b)
plt.show()

It seems that it is working with only the first point as 0 and all others 1, but when I change it like below it does not:

import pandas as pd
from sklearn.linear_model import SGDClassifier
X1 = {“xcoord1”:pd.Series([0,0,1,1]),“ycoord2”:pd.Series([0,1,0,1])}
X3 = pd.DataFrame(X1)
y = [0, 0,1,1]
clf = SGDClassifier(loss=“hinge”, penalty=“l2”)
clf.fit(X3, y)

import numpy as np
import matplotlib.pyplot as plt
plt.plot(X3[0:2],‘bo’)
plt.plot(X3[2:],‘ro’)
a=np.linspace(0.,1.,num=11)
b=(-a*clf.coef_[0,0]-clf.intercept_[0])/clf.coef_[0,1]
plt.plot(a,b)
plt.show()

Can you please help me understand?

Note only 3 lines are altered:

y = [0, 0,1,1]

and

plt.plot(X3[0:2],‘bo’)
plt.plot(X3[2:],‘ro’)