This is an example from ListPlot
in the Mathematica documentation.
ListPlot[Table[{k,PDF[BinomialDistribution[50, p], k]}, {p, {0.3, 0.5}}, {k, 0, 50}],
Filling -> Axis, PlotLegends -> {0.3, 0.5}, Joined -> True]
In this example, I want to limit the filling range from 10.5 to 20.8 on x-axis of the blue one and the filling range from 15.2 to 27.4 on x-axis of the yellow one.
Edit
Actually, my lists are:
list1 =
{{-2.,0.}, {-1.9,0.}, {-1.8,0.}, {-1.7,0.}, {-1.6,0.}, {-1.5,0.}, {-1.4,0.},
{-1.3,0.}, {-1.2,0.}, {-1.1,0.}, {-1.,0.}, {-0.9,0.}, {-0.8,0.}, {-0.7,0.},
{-0.6,0.}, {-0.5,0.}, {-0.4,0.}, {-0.3,0.}, {-0.2,0.}, {-0.1, 0.0000270029},
{0.,0.573}, {0.1, 0.944375}, {0.2, 0.905604}, {0.3, 0.876333}, {0.4,0.856429},
{0.5,0.842903}, {0.6,0.833816}, {0.7,0.823825}, {0.8,0.82225}, {0.9,0.820646},
{1.,0.824455}, {1.1,0.820966}, {1.2,0.82971}, {1.3,0.838609}, {1.4,0.833386},
{1.5,0.847014}, {1.6,0.845375}, {1.7,0.831121}, {1.8,0.858744}, {1.9,0.878679},
{2.,0.883768}, {2.1,0.895884}, {2.2,0.916524}, {2.3,0.883408}, {2.4,0.820855},
{2.5,0.812862}, {2.6,0.850007}, {2.7,0.85677}, {2.8,0.917854}, {2.9,0.860092},
{3.,0.826174}};
list2 =
{{-2., Indeterminate}, {-1.9, Indeterminate}, {-1.8, Indeterminate},
{-1.7, Indeterminate}, {-1.6, Indeterminate}, {-1.5, Indeterminate},
{-1.4, Indeterminate}, {-1.3, Indeterminate}, {-1.2, Indeterminate},
{-1.1, Indeterminate}, {-1., Indeterminate}, {-0.9, Indeterminate},
{-0.8, Indeterminate}, {-0.7, Indeterminate}, {-0.6, Indeterminate},
{-0.5, Indeterminate}, {-0.4, Indeterminate}, {-0.3, Indeterminate},
{-0.2, Indeterminate}, {-0.1, 0.000978548}, {0., 0.0216139},
{0.1, 0.0159094}, {0.2, 0.0246127}, {0.3, 0.0432556}, {0.4, .0698127},
{0.5, 0.100648}, {0.6, 0.13547}, {0.7, 0.171693}, {0.8, 0.210745},
{0.9, 0.251159}, {1., 0.294236}, {1.1, 0.32755}, {1.2, 0.367015},
{1.3, 0.398382}, {1.4, 0.402279}, {1.5, 0.405745}, {1.6, 0.370707},
{1.7, 0.343634}, {1.8, 0.325424}, {1.9, 0.325361}, {2., 0.28044},
{2.1, 0.330616}, {2.2, 0.272563}, {2.3, 0.281717}, {2.4, 0.37461},
{2.5, 0.433955}, {2.6, 0.210232}, {2.7, 0.276848}, {2.8, 0.39585},
{2.9, 0.55642}, {3., 1.53635}};
When the lists are like this, how can I limit the filling ranges along the x-axis from 0.23 to 1.67 in list1
and from 1.23 to 2.34 in list2
?
Interpolation[]
withInterpolationOrder -> 1
on your points, and use the techniques in the thread corey linked to. $\endgroup$