# Draw Graph with upper and lower limit

I am attempting to draw a graph with a slope of 200,000 that becomes "saturated" at $y= \pm 10$. Essentially, the graph is of the form $y=200000x$. However, I have been unsuccessful in getting it to level off at the y bounds. I want the graph to become a horizontal straight lines at those values, like this, where my A would be 200000 and my Vcc values would be $\pm 10$: Thank you!

x0 = First[x /. Solve[2 10^5 x == 10]]


1/20000

y[x_] := Piecewise[{{2 10^5 x, -x0 < x < x0}, {10, x >= x0}, {-10, x <= x0}}]

plot = Plot[y[x], {x, -2 x0, 2 x0}, Frame -> True] Or in another way, using Clip as requested by C. E.:

Plot[Clip[200000 x, {-10, 10}], {x, -2 x0, 2 x0}, Frame -> True]


which gives the same plot as above.

• Oh that's brilliant. Totally forgot about piecewise functions. Thanks so much! – tyler a Sep 10 '16 at 22:01
• Since you've answered this question and it has already been accepted, would you mind also writing about Clip? – C. E. Sep 10 '16 at 22:10