It's been impossible finding an answer to this question. If you have a simple linear graph, you have one slope and one intercept abline(intercept = 1, slope = .5; if you plot a regression, you can easily insert the result of the regression into abline function; however, let's say you're running a perceptron model with two features/variables you would get the line m1x1 + m2x2 + b. How can you add these two coefficients to the abline() function? It should be the same in Python as R, so feel free to use whatever code is easier for you.
I mostly use R but I'm in a course for Python, but I find that ggplot works much better than matplotlib or seaborn, and I can use it from within Python.
With regard to a minimal reproducible example: in python, let's use the iris dataset. I have the slope 1 and slope 2 of -0.2 and 1 and an intercept of 0. Here is the ggplot code I have for plotting the first slope, but not being able to plot the second:
from plotnine import ggplot, aes, geom_point, geom_histogram, geom_abline
ggplot(iris_df_feat_13, aes(x="sepal_width", y="petal_width", color="target")) + geom_point()+ geom_abline(intercept = 0, slope = -.2, color="red",
linetype="dashed", size=1.5)
iris = datasets.load_iris()
x = iris.data
y = iris.target
y = pd.Series(y, name = 'target')
iris_df = pd.DataFrame(x, columns = ['sepal_length', 'sepal_width', 'petal_length', 'petal_width'])
iris_df = iris_df.join(y) #remember this.
vals = [0,1]
iris_df_01 = iris_df.query('target == @ vals')
iris_df_01[['target']] = iris_df_01[['target']].replace(0, -1)
iris_df_feat_13 = iris_df_01[['sepal_width', 'petal_width', 'target']]
iris_df_feat_13