# ListLinePlot partial filling

I use ListLinePlot to plot data:

data = {1.76703857907629*10^-05, 4.81140563002228*10^-05,
0.000289014453115104, 0.00197771091043209, 0.0110423194539717,
0.0498810246783513, 0.190154244971562, 0.627874813716429,
1.80989253153018, 4.54933071011039, 9.93984896528626,
18.8366788617287, 30.9406437229311, 44.0665972030142,
54.4589381973665, 58.4368628024863, 54.4589381973665,
44.0665972030142, 30.9406437229311, 18.8366788617287,
9.93984896528626, 4.54933071011039, 1.80989253153018,
0.627874813716429, 0.190154244971562, 0.0498810246783513,
0.0110423194539717, 0.00197771091043209, 0.000289014453115104,
4.81140563002228*10^-05, 1.76703857907629*10^-05}
x1=ListLinePlot[data]
x2=ListLinePlot[data, Filling -> Axis]


But now I only want to fill the data from x=10 to x=20. I didn't find anything liek partial filling depending on the x-axis in the documentary or here at mathematica.SE.

Is there a simple solution or do I have to play with partial plots, which I combine with Show?

• You can overlay two plots. Make one unfilled plot with all the data, one filled plot with a subset of your data, and combine with Show[]. – J. M. is away Jul 3 '15 at 10:49
• @Guesswhoitis. ok thanks. that was one option which i thought might work. good to have a confirmation that there is no simpler way. thanks! – NicoDean Jul 3 '15 at 10:57
• There might be a simpler way I'm missing; I just threw out one of the things that could be tried in this situation. – J. M. is away Jul 3 '15 at 11:01

data2 = data; data2[[;; 9]] = Null; data2[[21 ;;]] = Null;
ListLinePlot[{data, data2}, Filling -> {2 -> Axis}]


Or

data3 = MapIndexed[{First@#2, #} &, data];
data3b = Select[data3, 10 <= #[[1]] <= 20 &];
ListLinePlot[{data3, data3b}, Filling -> {2 -> Axis}]
(* same picture *)

• Ah the first one is a nice solution. I expected that one could do it somehow like that. And I'm surprised that partial filling is not implemented more directly; expected that it might be used quite often. Thanks a lot! – NicoDean Jul 3 '15 at 11:29
• Oh, and now I learned that Null!=0. That is very important! Thanks :) – NicoDean Jul 4 '15 at 14:27