## Matplotlib Tutorial 4 – Scatter Plots

Next up, we cover scatter plots! The idea of scatter plots is usually to compare two variables, or three if you are plotting in 3 dimensions, looking for correlation or groups.

sample code: http://pythonprogramming.net
http://hkinsley.com
http://sentdex.com
http://seaofbtc.com

Source

### Comment List

• sentdex
November 30, 2020

Well done. I keep picking up helpful bits and pieces of what I need here. Looking forward to more. Source documentation is difficult to understand for me by myself.

• sentdex
November 30, 2020

1:10 lol that pause while he’s whether or not to name it scat

• sentdex
November 30, 2020

pyaudio tutorial?

• sentdex
November 30, 2020

It's awesome, though it's 2020 already.

• sentdex
November 30, 2020

Hello sir, I appreciate your efforts. How can I use matplotlib to display the chat inside web page?

• sentdex
November 30, 2020

Sir, how to use x, y and one more variable and plot on a map, where x is longitude and y is latitude. If we give this from a csv file?

• sentdex
November 30, 2020

Wanna kno how to plot value of the bar at the top..i have used solutions on internet…but each value is not coming above the bar…both the values are coming at the top of the bar…can you help?

• sentdex
November 30, 2020

hey man Thanks for all these video I will go give you fucking something good some day to make up for the goods you are doing to all of us
least is I remember your name and I'll tell my colleagues

• sentdex
November 30, 2020

Could any intelligent human tell me how can I animate vectors (arrows) in Matplotlib. I've tried many different ways and they either not move the vector or Python gives an error (something like: You can not update data from vector, plt/ax.arrow).
I'm a noob and I've been stuck for a while with this problem, so I would really appreciate ANY idea.
Thanks

• sentdex
November 30, 2020

i love ur videos!! they're make me easier to understand. thankful

• sentdex
November 30, 2020

can I use 6-digit Hex codes for color designations? Thank you!

• sentdex
November 30, 2020

What's going on everybody? Welcome to …….. tutorial video. In this video………
Btw, you are great 🙂

• sentdex
November 30, 2020

Tutorials for people who can’t use help()

• sentdex
November 30, 2020

please make video on self driving cars

• sentdex
November 30, 2020

where's the english legend?

• sentdex
November 30, 2020

how do you draw the line of best fit

• sentdex
November 30, 2020

HOW TO DO IT IF YOU ARE GOING TO WRITE X AND Y BOTH IN THE SAME AXIS WHEREAS HAVING A COMMON Y AXIS?

• sentdex
November 30, 2020

Did anyone ever told you that you look like "MARK ZUCKERBERG" .

• sentdex
November 30, 2020

You are the best Python Teacher!

• sentdex
November 30, 2020

godammit, i need to make a bubble plot after merging data from 2 csv files into one dataframe and after making calculations on the data to produce another dataframe from which I'll make a bubble plot. nothing, no where do I see how to do. Every fucking video uses numpy and random. god fucking dammit

• sentdex
November 30, 2020

Thank you very much for this tutorial! I just want to point out that the size attribute became "markersize" in the latest version of matplotlib

• sentdex
November 30, 2020

dud youre gowd

• sentdex
November 30, 2020

You are fuckin amazing!!!! thanks for these!

• sentdex
November 30, 2020

The "I will fight you" at 3:31 resonates with me and my daily coding experience.

• sentdex
November 30, 2020

How can we get the fitting line from this skitscat if we have already estimated by OLS fuction?

• sentdex
November 30, 2020

Thank you so much 😀

• sentdex
November 30, 2020

Thanks, man! It is really helpful!

• sentdex
November 30, 2020

Hi, I copied the code exactly but it is not showing label in the right top corner of the scatter plot box.

• sentdex
November 30, 2020

Thank you! You are a life saver!

• sentdex
November 30, 2020

How would you make a scatter plot, when the X-axis is date and y is price, like in stock data? Can we convert the dates to some integer to use?

• sentdex
November 30, 2020

Amazing you are!

• sentdex
November 30, 2020

Great videos. BTW, I am not sure if we can use python logo for our products unless we have permission!?

• sentdex
November 30, 2020

Great video!

• sentdex
November 30, 2020

I think default size is 20 for marker.

• sentdex
November 30, 2020

your tutorials rock. I am learning pyplots very easily through them.

• sentdex
November 30, 2020

Hi, could you explain the best way to turn a continuous function into an array? If say, y = sin(x) and x = linspace(1,10,11), is there a snappy way to plot without making an array of y values?

• sentdex
November 30, 2020

Again, very helpful!!! Here is scatter plot that I did that has two sets of data (males vs females) doing a scatter plot of height vs weight…# scatter plot#import matplotlib.pyplot as plt
x1=[68,74,69,68,72,66,71]
y1=[145,157,158,182,204,144,198]#x2=[61,63,65,67,69]
y2=[107,118,122,144,132]#plt.scatter(x1,y1,label="Males",marker="+",s=100)
plt.scatter(x2,y2,label="Females",marker="o")#plt.xlabel("Height(inches)")
plt.ylabel("Weight(pounds)")
plt.title("Interesting graphnHeight vs weight")
plt.legend()
plt.show()

• sentdex
November 30, 2020

+ sentdex
Again thanks for awsome video. Could you please help me if you want to replace the bar kind of display to line graph, what would be the keyword for that ?

Thanks again !

• sentdex
November 30, 2020

how do you type the star?

• sentdex
November 30, 2020

ValueError: Invalid vertices array. i get that is it because i have large numers. I have isolated two columns.

• sentdex
November 30, 2020

hi can you please explain what this funtion does ax = plt.gca() ?