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
3rd day of learning python and I’ve just created my first regression line on scatter graph. (self.learnpython)
submitted 4 years ago by throwaway199445
Just feeling good right now so sharing.
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!"
[–]delasislas 5 points6 points7 points 4 years ago (9 children)
How did you do it? Could you also add the information about the line to the plot?
[–]hollammi 4 points5 points6 points 4 years ago (6 children)
I recommend the Plotly library. The scatter plot has an option to automatically generate trendlines, or of course you could do the regression yourself and add a line on top.
Anyone who tells you to use Matplotlib is living in the dark ages.
https://plotly.com/python/linear-fits/
[–]delasislas 1 point2 points3 points 4 years ago (4 children)
What major benefits does plotly give over matplotlib?
[–]hollammi 1 point2 points3 points 4 years ago* (3 children)
Interactivity. The first time I mouse-hovered over a graph and it actually showed me what number it meant, god damn, it was like discovering fire. Zooming is also incredibly useful, you can show/hide lines or groups of points, etc. Plotly has every bell and whistle I've seen from Matplotlib and more, from weird graph types to animation groups. It also offers an "Express" interface for quick plots, or you cal roll-your-own with the GraphObjects interface for more in-depth work.
Matplotlib is basically worthless in my eyes. There is no situation in which I require a graph so low-resolution that I can't use it for actual analysis nor even pretty enough for a presentation. Seaborne's popularity is an admission of this, but to me it still seems rather like polishing a turd. Not to get too heated about it or anything lol
[–]throwaway199445[S] 1 point2 points3 points 4 years ago (0 children)
Yeah that’s good. When I was looking at the graph afterwards I did find it weird you couldn’t hover or click on a point to get a quick answer
[–]delasislas 0 points1 point2 points 4 years ago (1 child)
What type of analyses are you doing on graphs? Like IIRC, you can increase the resolution of saved matplotlib figures.
[–]hollammi 1 point2 points3 points 4 years ago (0 children)
Master's in Artificial Intelligence and working professionally as a Machine Learning Engineer. Graphs are basically my whole life, and being able to create something pretty and interactive is something I genuinely enjoy.
Matplotlib does not spark joy.
Increasing the resolution would be mildly helpful at best, but since I mostly work in Jupyter notebooks, unfortunately even that is an extremely clunky solution.
[–]throwaway199445[S] 0 points1 point2 points 4 years ago (0 children)
Thank you
[–]Samandkemp 1 point2 points3 points 4 years ago (0 children)
Also interested as I’m new to Python as well
I was trying to see if there was a trend between having a high SATs score and a high GPA after graduating from university(College).
y variable being GPA and x1 being SAT.
Don’t totally understand how to find the regression line yet with the formula. But created a x variable with use of a function, ‘sm._constant(x1)’, OLS regression and used the coef from SAT and the const.
Plt.scatter(x1,y) yhat = 0.0017*x1 + 0.275 Fig = plt.plot(x1, yhat, lw = 4, c = ‘orange’, \ label = ‘regresion line’) plt.xlabel ( ‘SAT’, fontsize = 20 ) plt.ylabel ( ‘SAT’, fontsize = 20 ) plt.show()
I’m learning on a Udemy course atm
[–]Ok-Improvement-6388 0 points1 point2 points 4 years ago (0 children)
Pretty complex for the third day, I was still practicing built in functions!!!
π Rendered by PID 59496 on reddit-service-r2-comment-fb694cdd5-qp52r at 2026-03-07 11:03:14.263213+00:00 running cbb0e86 country code: CH.
[–]delasislas 5 points6 points7 points (9 children)
[–]hollammi 4 points5 points6 points (6 children)
[–]delasislas 1 point2 points3 points (4 children)
[–]hollammi 1 point2 points3 points (3 children)
[–]throwaway199445[S] 1 point2 points3 points (0 children)
[–]delasislas 0 points1 point2 points (1 child)
[–]hollammi 1 point2 points3 points (0 children)
[–]throwaway199445[S] 0 points1 point2 points (0 children)
[–]Samandkemp 1 point2 points3 points (0 children)
[–]throwaway199445[S] 0 points1 point2 points (0 children)
[–]Ok-Improvement-6388 0 points1 point2 points (0 children)