Plotting functions with keyword arguments

I define a simple function:

my_line(x;m=1,b=0)=m*x+b

I plot my simple function:

plot(my_line,-10,10,framestyle=:origin)

Great, no problem.

Now I want to change a keyword parameter in my_line, m=-1.

How do I do this in the plot call (ie without altering the function definition)?

eg, plot(my_line(x;m=-1),…) and plot(my_line,m=-1,…) etc… have failed to produce the desired result.

It should work with an anonymous function like so:
plot(x -> my_line(x;m=-1),…)

2 Likes

did the job, thanks!