2
$\begingroup$

This question already has an answer here:

So, I just want to plot the area between two lines a color - the lines themselves should be invisible. It must be in ListPlot

l1 = Table[{n, n}, {n, 50}];
l2 = Table[{n, n - 10}, {n, 50}];
ListPlot[ {l1, l2}, Joined -> {True, True}, PlotRange -> All, 
 Filling -> {1 -> {{2}, {Lighter[LightBlue, 0.7]}}}]

That returns the area

enter image description here

But, I still need to remove the lines, lets try by making the thickness zero

ListPlot[ {l1, l2}, Joined -> {True, True}, 
 PlotStyle -> {Thickness[0], Thickness[0]}, PlotRange -> All, 
 Filling -> {1 -> {{2}, {Lighter[LightBlue, 0.7]}}}]

Nope, that doesn't work.

enter image description here

Lets try a negative thickness.

 ListPlot[ {l1, l2}, Joined -> {True, True}, 
 PlotStyle -> {Thickness[-2], Thickness[-2]}, PlotRange -> All, 
 Filling -> {1 -> {{2}, {Lighter[LightBlue, 0.7]}}}]

That works

enter image description here

Until you try to export it

graph = ListPlot[ {l1, l2}, Joined -> {True, True}, 
   PlotStyle -> {Thickness[-2], Thickness[-2]}, PlotRange -> All, 
   Filling -> {1 -> {{2}, {Lighter[LightBlue, 0.7]}}}];

Export["graphmew.jpeg", graph]

And our lines return.

enter image description here

Why do the lines return and how can I get rid of them.

$\endgroup$

marked as duplicate by Alexey Popkov, MarcoB, happy fish, corey979, m_goldberg plotting Mar 8 '17 at 14:38

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    $\begingroup$ Try with Opacity $\endgroup$ – corey979 Mar 7 '17 at 23:38
  • 2
    $\begingroup$ A very similar question was posted recently: mathematica.stackexchange.com/q/139247/121 Incidentally I was not aware that Thickness[-2] would have the effect you show; I assumed it was invalid input. Nevertheless that question itself contains what should be a working solution for you. Please take a look and report if you have problems applying it. $\endgroup$ – Mr.Wizard Mar 7 '17 at 23:51
  • 3
    $\begingroup$ By the way I suggest you post Thickness[-2] as an answer to that linked question; it is certainly relevant there and you deserve credit for posting it. $\endgroup$ – Mr.Wizard Mar 7 '17 at 23:53
1
$\begingroup$

Try this:

PlotStyle -> {None, None}
$\endgroup$
  • 1
    $\begingroup$ PlotStyle -> None is sufficient $\endgroup$ – Bob Hanlon Mar 8 '17 at 1:25
  • $\begingroup$ @Bob Hanlon: Yep. Thanks. $\endgroup$ – David G. Stork Mar 8 '17 at 1:30

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