When you draw a bunch of transparent lines in matplotlib like this, you get a nice effect; when they overlap they are a bit darker.
from pylab import *
for _ in xrange(1000) :
plot(np.random.randn(2),np.random.randn(2),alpha=0.1,color='k')
show()
It looks like this:
But if you draw one long line like this that overlaps with itself like this, the line doesn't "interact with itself." It looks like this:
I would like to draw a single curve that overlaps with itself, so that the more it overlaps with itself, the darker it becomes. If I use a loop to break up the curve and draw each line segment separately, I get what I want, but I also get ugly and unacceptable artifacts where the line segments meet, making the curve looked like a dotted or dashed line.. Like this:
Is there any nice way to draw a curve so that it becomes darker when it overlaps with itself, but you don't get artifacts like those just described?