Intro to Data Visualization in Python with Matplotlib! (line graph, bar chart, title, labels, size)

preview_player
Показать описание

Join the Python Army to get access to perks!

Yay finally posting again. Hopefully this video will help you get comfortable working through the matplotlib library. I'm going to post a follow up video with real-world examples (combining pandas with matplotlib) and different types of plots next week. I originally was going to include that in this one, but I thought the video was getting a bit too long.

In this video we walk through some of the basics of matplotlib. We start by making a simple line graph. We learn how to give the graph a title and label the x & y axis. We learn how to scale the graph by specifying the x & y tickmarks. After this, we restyle our line by passing in keyword arguments then do basically the same thing with a shorthand notation. We resize our graph and save it. Then we end with a simple bar chart.

Source Code (includes code and data for next video as well):

Matplotlib Pyplot Documentation:

Font List:

Install libraries Needed for this video:
Option 1:
Open up a terminal window and type
pip install matplotlib
pip install numpy
pip install pandas

Option 2:

Thanks for watching! Make sure to like and subscribe to not miss any future videos! Let me know if you have any questions.

---------------------------------------------

Follow me on social media!

--------------------------------------------

Video Timeline:
0:00 - Video overview (note real-world examples moved to next video)
1:43 - Setup
2:23 - Our first line graph!
4:50 - Add title and labels for x & y axis
7:13 - Change font type, size, etc.
9:02 - Change tick marks (scale graph)
11:20 - Add a legend
12:25 - Restyle our line (color, line style, markers, width)
15:53 - Shorthand notation to restyle lines
17:27 - List of line customization options
17:55 - Plot more complex lines
22:20 - Resize Graph
24:48 - Save Graph
26:00 - Annotating/Cleaning Code
27:00 - Bar Chart
31:25 - Final Comments

---------------------

*I use affiliate links on the products that I recommend. I may earn a purchase commission or a referral bonus from the usage of these links.
Рекомендации по теме
Комментарии
Автор

A great way to teach. I like that you show how to look for information on the referenced source. Thank you for sharing and for making these very useful online classes. :)

Taran
Автор

I am really grateful for your tutorial videos, you cover all the must-know topics, your explanations are easy to understand and watching you make mistakes sometimes makes me comfortable as someone who's learning.
You could totally roll out your own courses or work as a YouTuber (or become a teacher) if you want to!

RishikavsAnnie
Автор

Thank you Keith for the great video!
This is helping my a lot for my bachelor thesis.

hendrik
Автор

Congrats on finishing your degree, Keith!!! :) As a student who studies Education but would like to go into data analytics, your videos are super helpful and inspiring! By any chance, you could do more videos on how to build regression models in Python? :) Again, thanks for making these amazing tutorials!! :)

jenn
Автор

I'm finding your explanations much easier to understand than other channels.

Pythagoras
Автор

Thank you so much! I am now trying to go through every single one of your videos in data science section and have learned a lot!

oliviawu
Автор

Dude, I watch all your videos, you make videos very carefully, very instructive, thank you very much

fazlaynur
Автор

I like your videos, Keith! Simple, practical, to the point. Good job!

gintarasantis
Автор

You are becoming my favorite instructor. Keep it up, man!

azrmuradl
Автор

thanks keith for such an amazing video on matplotlib your content is very much structured and well taught the concept in very layman terms so even a non-techie can learn concept great video keep posting more

harshbhatt
Автор

You are very helpful and enjoyable. In an easy way you provide a lot of stuff to get anyone start using the libraries from scratch to a stisfying degree.

yhxtmtk
Автор

Happy to be back! Video Timeline:
0:24 - Video overview (note real-world examples moved to next video)
1:43 - Setup
2:23 - Our first line graph!
4:50 - Add title and labels for x & y axis
7:13 - Change font type, size, etc.
9:02 - Change tick marks (scale graph)
11:20 - Add a legend
12:25 - Restyle our line (color, line style, markers, width)
15:53 - Shorthand notation to restyle lines
17:27 - List of line customization options
17:55 - Plot more complex lines
22:20 - Resize Graph
24:48 - Save Graph
26:00 - Annotating/Cleaning Code
27:00 - Bar Chart
31:25 - Final Comments

If you enjoyed this video, make sure to like and subscribe! :)

KeithGalli
Автор

Hey Keith u are amazing at making virtual lessons with an understandable concept and ur way of teaching is quite good. Hope u will make more vedios on all the programming languages

nareshreddy
Автор

I watched about 2/3 of your Pandas video, it's the visual stuff that I'm after, so I'll try this one.

kristypolymath
Автор

Thank you, I am happy I found these videos on the right time.

muzaianghanem
Автор

Thank you for this great video!! This should be helpful for all beginners of matplotlib!!

mikitakamaru
Автор

Thank you so much for making this, Keith

gianluigimarudut
Автор

An idea for a tutorial might be making a 3D plot or surface with data collected through a Tkinter application. Great video, thank you)

havehalkow
Автор

it's very helpful & useful to me.
thanks for your recording 💖

alizareei
Автор

For those curious, you can use plt.annotate() to add the coordinates of markers to the graph.

x = [your x coordinates list]
y = [your y coordinates list]
for i, j in zip(x, y):
plt.annotate(f'({i}, {j})', (i, j), textcoords='offset points', xytext=(0, 5), ha='center')

You can play around with the options, but this will add the coordinates centered slightly above the markers. If 5 seems too close, 10 is a better option.

TSPxEclipse