Re: Filling in ListPlot
- To: mathgroup at smc.vnet.net
- Subject: [mg105085] Re: Filling in ListPlot
- From: dh <dh at metrohm.com>
- Date: Fri, 20 Nov 2009 06:40:03 -0500 (EST)
- References: <he36dp$eci$1@smc.vnet.net>
fd wrote: > All > > I'm having problems with Filling in ListPlot. I have two curves and > would like different colors as one curve goes above the other, here > goes the code; > > aris = {10000, 5000, 1000, 500, 100, 50, 20}; y = 10000; > > elist = Flatten[ConstantArray[#, IntegerPart[y/#]] & /@ aris]; > > n = 1; > ariList = Reverse[{N[y/n++], #} & /@ elist] > > ListLogLogPlot[{ariList, {{1, 1}, {100000, 100000}}}, > PlotRange -> All, InterpolationOrder -> {0, 1}, Joined -> True, > Filling -> {2 -> {{1}, {Yellow, Orange}}}] > > If I define a interpolation function myself it works, but it is a bit > of a nuisance > > f[x_] = Interpolation[ariList, InterpolationOrder -> 0][x]; > > LogLogPlot[{f[x], x}, {x, 10, 10000}, > Filling -> {2 -> {{1}, {Yellow, Orange}}}] > > > Is there a way of making it work correctly with ListPlot ? Would this > be a bug ? > > Best > F. > > > > > > > Hi, there seems to be a bug with interpolation and filling. The filling seems not to take interpolation into account. Consider the following, setting n1=10, 100, 1000, 10000: n1 = 10; ListLogLogPlot[{ariList, Table[{x, x}, {x, 1, 10000, n1}]}, PlotRange -> All, Joined -> True, InterpolationOrder -> {0, 1}, Filling -> {2 -> {{1}, {Red, Blue}}}] Daniel