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?
Answer
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)
Comments
Post a Comment