# Display splines - problem with conditional expression

I have implemented cubic spline on my own and it is working properly (table SplineProbe consists piecewise of cubic functions). Right now I would like to display in on a grid of 100 points.

What I did is creating the following (xList contains the x-values of the grid):

ConditionalTable =
Table[With[{i = i},
ConditionalExpression[SplineProbe[[i]][#],
xList[[i]] <= # <= xList[[i + 1]]] &], {i, 1, 99}];

Trial = Table[
Plot[ConditionalTable[[i]][x], {x, First[xList], Last[xList]},
PlotStyle -> {Red, Thick}], {i, 1, 99}];

Apply[Show, {Trial, ListPlot[Points], PlotStyle -> Gray,
PlotRange -> All}]


The result I obtain looks like that: When I am trying to display the ommited parts separately, it works only if the bounds are the ones the particular spline has been defined for:

TrialPart = Plot[ConditionalTable[][x], {x, 0.002, 0.003},
PlotStyle -> Dashed] Here combination of those two (small dashed part between 2nd and 3rd point): The funny thing is, if I apply the whole thing on a narrower domain, it works properly: I am so confused, I don't even know where to look for my mistake. Each hint would come in handy for me.

Edit:

It is as if the ConditionalExpression function couldn't manage long intervals. The first five elements of the xList are {0.001,0.002,0.003,0.004,0.005}. If I try to obtain:

trial1 = Plot[ConditionalTable[][x], {x, 0.001, 0.005}]
trial2 = Plot[ConditionalTable[][x], {x, 0.001, 0.005}]
trial3 = Plot[ConditionalTable[][x], {x, 0.001, 0.005}]
trial4 = Plot[ConditionalTable[][x], {x, 0.001, 0.005}]

Apply[Show, {trial1, trial2, trial3, trial4, PlotRange -> All}]


it works: As soon as I widen my domain, it stops working properly:

trial1 = Plot[ConditionalTable[][x], {x, 0.001, Last[xList]}]
trial2 = Plot[ConditionalTable[][x], {x, 0.001, Last[xList]}]
trial3 = Plot[ConditionalTable[][x], {x, 0.001, Last[xList]}]
trial4 = Plot[ConditionalTable[][x], {x, 0.001, Last[xList]}]

Apply[Show, {trial1, trial2, trial3, trial4, PlotRange -> All}] • What happens if you use the following options in Plot: PlotPoints -> 4n where n is the number of SplineProbes you have and additionally MaxRecursion->5? – halirutan Feb 5 '18 at 12:09
• It works! Thank your very much :) But why doesn't it work without those options? It seems like a casual iteration. – aniager Feb 6 '18 at 7:31