My code is
ListLinePlot[{
{{0, 185}, {-10, 187}, {-20, 186}, {-30, 158}, {-40, 159}, {-60, 116}},
{{0, 155}, {-10, 132}, {-20, 165}, {-30, 112}, {-40, 85}, {-60, 95}}},
Filling -> {1 -> {2}}]
Why doesn't Filling
work on my plot?
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityMy code is
ListLinePlot[{
{{0, 185}, {-10, 187}, {-20, 186}, {-30, 158}, {-40, 159}, {-60, 116}},
{{0, 155}, {-10, 132}, {-20, 165}, {-30, 112}, {-40, 85}, {-60, 95}}},
Filling -> {1 -> {2}}]
Why doesn't Filling
work on my plot?
Actually, this is more a long comment than a full answer. It seems to me that it is struggling with the fact that you (1.) supply x-coordinate in (2.) decreasing/"unsorted" order. Sorting it fixes it, try:
ListLinePlot[{
Sort@{{0, 185}, {-10, 187}, {-20, 186}, {-30, 158}, {-40, 159}, {-60, 116}},
Sort@{{0, 155}, {-10, 132}, {-20, 165}, {-30, 112}, {-40, 85}, {-60, 95}}},
Filling -> {1 -> {2}}]
Alternatively, in your case (of strictly decreasing x-coords), you could use Reverse
.
For the "Why?", I do not know, maybe somebody else can help? (I cannot see a word on that in ListLinePlot
documentation, in particular in the possible issues section)
{1->{2}}
and {2->{1}}
shouldn't change a thing. Thanks for pointing that out!
$\endgroup$
– Pinguin Dirk
Aug 9 '13 at 12:40
ListLinePlot[Transpose@{{3, 4, 6, 5, 7, 8}, {2, 2, 1, 1, 2, 2}}, PlotRange -> {0, 3}, Filling -> Axis]
$\endgroup$ – Dr. belisarius Aug 9 '13 at 12:14