python 3.x – error in inline matplotlib

escribo este código
% matplotlib inline
import sklearn.datasets
import matplotlib.pyplot as a plt
import matplotlib
import numpy as np

matplotlib.style.use ("ggplot") # makes the parcels pretty

np.random.seed (0)
X, y = sklearn.datasets.make_moons (200, noise = 0.2)
plt.scatter (X[:,0], X[:,1], s = 40, c = y, cmap = plt.cm.Spectral)

repent the consola me genera este error
"C: Users USER PycharmProjects support vector venv Scripts python.exe" "C: / Users / USER / PycharmProjects / support vector / ABC.py"
File "C: / Users / USER / PycharmProjects / support vector / ABC.py", line 1
% matplotlib inline
^
SyntaxSyntax: Invalid syntax

Process completed with exit code 1

Cual sería una solución?