Slope¶
-
Slope
(slope, intercept, args...; kvs...)¶ PlotComponent
to draw a straight line with slopeslope
. The vertical offset is given byintercept
which must be a tuple of length 2 containing the coordinates of a point on the line.args
andkvs
can be used to set additional style attributes.
Example¶
x = linspace(0, 10)
p = plot(x, x + 1 ./ x, yrange=[-0.5, 10.5])
s = Slope(1, (5, 5), color="red", linekind="dashed")
add(p, s)