Dr. Hartmut Ehmler wrote:
> I have a single plot with x ranging from [0:100] and data points in that
> interval. Then I want to add a function f(x) , which describes the data
> only in a limited interval, e.g. [0:50]. How do I add the function with
> that range to the plot? If I try "plot [0:50] f(x), data" gnuplot will
> always change the x range of the whole plot and I cannot see the data from
> [50:100].
Try using the ternary operator as part of your function definition (help ternary). Define the support in the range of [0,50], e.g.,
f(x) = x<0 && x>50 ? 1/0 : <function definition>
(If you want the function to actually be zero outside its support, replace 1/0 with 0.)
Then try plotting with range [0:100]
Dan
|