Geek Culture
Published in

Geek Culture

Fitting a line to a scatter plot in Matplotlib

Photo by Mike U on Unsplash

In this article we see how to fit a straight line to the data in a scatter plot.

As a simple example of a scatter plot, for a group of people we might record their height and their shoe size. A scatter plot would then consist of one dot for each person, indicating their height (x) and shoe size (y).




A new tech publication by Start it up (

Recommended from Medium

Walmart Retail Analysis

Data Gems for the Public: Innovative ways and best practices to communicate official statistics

How to turn your 8 Google Analytics dashboard metrics into boat loads of insights

On The Spatial Model Of Public Opinion, Part One: Exploring Graphical Options

Powerplay dominance in the IPL

Predicting the survival of Titanic disaster

Search Autocomplete Personalisation

Market Basket Analysis with R

Image result for market basket analysis

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Martin McBride

Martin McBride

Software developer. Java, Python, C++ etc. I write for and maintain the generativepy library.

More from Medium

Python Shorts — Earth Distance

Map of the world with someone’s hands pointing out landmarks.

Seaborn Relplot in Python: Visualising Relationships in Data

A Soft Introduction to Plotly

How to test normality, skewness and kurtosis using Python