Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Filling in ListPlot

57 views
Skip to first unread message

fd

unread,
Nov 19, 2009, 5:24:57 AM11/19/09
to
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.

Sjoerd C. de Vries

unread,
Nov 20, 2009, 6:38:18 AM11/20/09
to
The Filling documentation uses the same trick (I guess that's where
you took it from), so I assume this is the best way to do it.

dh

unread,
Nov 20, 2009, 6:55:49 AM11/20/09
to

fd wrote:

> All

>

> goes the code;

>

>

>

> n = 1;

>

>

> of a nuisance

>

>

>

>

> 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

0 new messages