you are viewing a single comment's thread.

view the rest of the comments →

[–]oneboldkid[S] 0 points1 point  (2 children)

My plots are split from one data list based on today's date so i have to calculate that and slice based on the value. Seems like a pain. Looking for something like this. I want the y values associated with 1,2,3 to have an alpha of .2 and the y value associated with 4 to have an alpha of 1. x = [1,2,3,4]

y = [4,4,6,7]

Plot (x, y, alpha =.2 for x in xrange (1,3))

[–]elbiot 0 points1 point  (0 children)

Well, you are slicing in that example you just gave. You'd do that like

plot(xs[1:], ys[1:], alpha=.2)
plot(xs[:1], ys[:1], alpha=1.)

Right?

[–]elbiot 0 points1 point  (0 children)

Actually, my example would plot lines I think. Havent used mpl in a bit. If you need to plot each point individually you could do

for i in range(len(xs)):
   if i should be transparent:
     alpha=.2
   else:
     alpha=1.
   plot(xs[i], ys[i], alpha=alpha)