Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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?

share|improve this question
1  
Perhaps it's just a sanity check. ListLinePlot[Transpose@{{3, 4, 6, 5, 7, 8}, {2, 2, 1, 1, 2, 2}}, PlotRange -> {0, 3}, Filling -> Axis] –  belisarius Aug 9 '13 at 12:14
add comment

1 Answer 1

up vote 8 down vote accepted

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)

share|improve this answer
    
I note that you specify the Filling option differently than the OP. Any reason for that? –  Sjoerd C. de Vries Aug 9 '13 at 12:35
    
Good eyes! I was playing around a bit with other things and trying out stuff, forgot to change back. {1->{2}} and {2->{1}} shouldn't change a thing. Thanks for pointing that out! –  Pinguin Dirk Aug 9 '13 at 12:40
4  
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.