See SVM's separating hyperplane for 1D, 2D, and 3D data.

Start with 1D toy data:

Now try 2D toy data:

The decision boundary is defined by $\mathbf{wx} + b = 0$. To plot it in the 2D $\mathbf{x}$ case, we use $x$-coordinate $x_1$ and $y$-coordinate $x_2$. Let's solve for the $y$-coordinate $x_2$: $\mathbf{wx} + b = 0$ $\implies w_1 x_1 + w_2 x_2 + b = 0 \implies x_2 = -\frac{w_1 x_1 + b}{w_2}$. Now in Python $\mathbf{w}$ is given by clf.coef_[0] and $b$ is given by clf.intercept_, so the boundary is

x2 = -(clf.coef_[0][0] * x1 + clf.intercept_) / clf.coef_[0][1].

The constraints are $\mathbf{wx} + b \ge 1$ if $y = +1$ and $\mathbf{wx} + b \le -1$ if $y = -1$; use $=$ instead of $\ge$ or $\le$ to get the margin edges.

With these formulas in mind, let's plot the data, decision boundary, and margin edges.

Now let's try 3D data:

(modified from Support Vector Machines (SVM) clearly explained; data described at Iris plants dataset, which says "One class is linearly separable from the other 2; the latter are NOT linearly separable from each other," and sklearn.datasets.load_iris¶)