Plotting some piecewise functions in gnuplot

gnuplot

Solution

You can do it in that way:

f(x)=x<=1 ? -(x-1)**2+1 :  x>7 ? (-48)*sin(240)+1+0.5*x : (-(x-1)**2+1)*sin(30*x)+1
plot f(x)

Problem

Could you please tell me how can I plot functions that looks like: ``` f(x)=(x-1)^2 for 0 < x < 1 f(x)=(x-8)^2 for 1<=x<=7 f(x)=x for x>7 ``` in gnuplot. (If you could tell how to call such a kind of function in English I try to change the topic to the more appropiate).

Original source