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.

Here is what I am trying to plot:

randomWalk := NestList[# + RandomReal[{-1, 1}] &, 0, 1000];
Show[Table[ListPlot[randomWalk, Joined -> True], {100}], PlotRange -> Automatic]

Which gives:

enter image description here

What I'd like to do is give the lines a bit of transparency so that it is clearer to see the density of the plot at various areas; i.e. the darker the area, the more overlapping lines there are at that point. Since this is a ListPlot though, how can you change the properties - i.e. opacity - of the lines?

share|improve this question
add comment

1 Answer 1

up vote 5 down vote accepted

Putting the table inside ListPlot and setting the Opacity as part of the PlotStyle:

ListPlot[
  Table[randomWalk, {100}], 
  PlotStyle -> Directive[Blue, Opacity[0.25]], Joined -> True]

enter image description here

share|improve this answer
1  
PlotStyle -> Opacity[1/5, Black] also works. –  Alexey Popkov Apr 30 at 15:31
    
@Alexy - This one will run and run ;) –  Ymareth Apr 30 at 15:33
    
Brilliant, thank you @Ymareth and Oska –  Aron Apr 30 at 16:26
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.