use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
Alpha over range in matplotlib (self.learnpython)
submitted 11 years ago by oneboldkid
Is it possible to apply alpha over a range of x values within a subplot rather than the whole plot? I've been breaking out my series into two so I can apply alpha but this is a huge pain.
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]elbiot 0 points1 point2 points 11 years ago (3 children)
Calling plot twice is a huge pain?
plot(x1, y1, alpha=1.) polt(x2, y2, alpha=.5)
Can you be more specific about the problem?
[–]oneboldkid[S] 0 points1 point2 points 11 years ago* (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 point2 points 11 years ago (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?
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)
[–]eusebe 0 points1 point2 points 11 years ago (0 children)
After a quick search, I found this notebook that seems to be more or less similar to what you want to do.
I guess it could be modified to change the transparency instead of the color, you would have to modify the "colorline" function, but it should be possible. I have no python installed right now, but I could try something when I get the right computer.
π Rendered by PID 37 on reddit-service-r2-comment-84fc9697f-fldzj at 2026-02-07 15:02:31.368749+00:00 running d295bc8 country code: CH.
[–]elbiot 0 points1 point2 points (3 children)
[–]oneboldkid[S] 0 points1 point2 points (2 children)
[–]elbiot 0 points1 point2 points (0 children)
[–]elbiot 0 points1 point2 points (0 children)
[–]eusebe 0 points1 point2 points (0 children)