VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Matplotlib Crash Course

Matplotlib Crash Course

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Learn the basics of Matplotlib in this crash course tutorial. Matplotlib is an amazing data visualization library for Python. You will also learn how to apply Matplotlib to real-world problems. -- This course was created by Keith Galli. Check out his YouTube channel: https://www.youtube.com/channel/UCq6XkhO5SZ66N04IcPbqNcw - Source Code: https://github.com/KeithGalli/matplotlib_tutorial/ - Matplotlib Pyplot Documentation: https://matplotlib.org/api/_as_gen/matplotlib.pyplot.html - Font List: http://jonathansoma.com/lede/data-studio/matplotlib/list-all-fonts-available-in-matplotlib-plus-samples/ - Matplotlib Style Options: https://matplotlib.org/3.1.0/gallery/style_sheets/style_sheets_reference.html - Kaggle Data Link: https://www.kaggle.com/karangadiya/fifa19 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: Download anaconda which will contain all the packages we need. A video on how to do this is here: https://youtu.be/YJC6ldI3hWk
Date: 2022-03-14

Comments and reviews: 10


-My takeaways:-
-1. Line chart- 2:11
1.1 Potting a line chart using -plot- and -show- 3:27
1.2 Adding a title using -title- 5:21
1.3 Adding labels to x and y axes using -xlabel- and -ylabel- 6:24
1.4 Changing the font of title and labels. Resizing title and labels using -fontdict- 7:02
1.4 Editing tick marks using -xticks- and -yticks- 8:50
1.5 Adding a legend using -legend- 11:04
1.6 Changing line style by passing parameters to -plot- 12:14
1.7 Adding a 2nd line 17:33
1.8 Resizing a chart using -figure(figsize(), dpi=)- 21:55
1.9 Saving a chart using -savefig- 24:34
-2. Bar chart- 26:48
2.1 Potting a bar chart using -bar- and -show- 27:40. The size of a bar chart can be changed using -figure(figsize(), dpi=)- as well
2.2 Setting bar patterns using -set_hatch- 28:50
-3. Real world Matplotlib examples- 31:10
3.1 Example 1 - line chart 34:36. Input .csv data file using -pandas pd.read_csv()-
3.2 Example 2 - histogram 52:35. Potting a histogram using -hist- and -show- . Setting bins.
3.3 Example 3 - pie chart 1:00:08. Potting a pie chart using -pie- and -show- . Looking for a condition in the data using -pandas loc- . Adding labels for pie chart using a list. Changing colour. Show percentage using -autopct-
3.4 Example 4 - another pie chart 1:07:20. Converting string data to integer data using -strip- . Changing the pie chart style using -style.use- . Using -pctdistance- to define the positions of percentage. Using -explode- to split the pie chart.
3.5 Example 5 - box plot 1:18:33. Potting a box plot using -boxplot- and -show- . Using -set- to set colour and linewidth

reply

At 8:30, I did the same thing on my own. My Jupyter notebook says
findfont: Font family ['Comic Sans MS'] not found. Falling back to DejaVu Sans.
findfont: Font family ['Arial'] not found. Falling back to DejaVu Sans.
At 39:48, when I didn't write label, legend didn't work.
I am using the current version of matplotlib, which is 3.4.2. But I don't use Anaconda. Could it make such differences?

reply

If you were to read a binary file containing sample points,
file = open(-sample.bin-, -rb-)
How could you import the data into an array, for plotting? For example, assuming you prompt the user for filename, the number of bytes per data, and the endiness.. i.e. the first byte is the MSB or LSB... how would you load/plot the array, data value on the y, and sample number on the x?

reply

Peace to all, at the moment I am making a web-based item lending form, which I want to ask how is it so that when inputing time is not conflicting, for example: If person A enters the form -will- borrow goods from 02:00 - 03:00 , then person B cannot input the loan form with the same item between the hours of 2:00 to 3:00. how to avoid conflicts in the database.
reply

46:30
for country in gas:-
if country != 'Year':-
plt.plot(gas.Year, gas[country], marker ='.')
how did you manage to put labels for each country?
Ps. throws error that says 'No handles with labels found to put in legend.'

reply

1:02:49 In this case we also can use Counter from collections
count = Counter(fifa_data[-Preferred Foot-])-
left = count[-Left-]-
right = count[-Right-]-
nan = count[-nan-]

reply

I can easily tell that Keith is very keen on FUT and probably has like the best Ultimate team in FIFA 21 ahahahha. Really enjoyed your course, very coherent and simple. Thank you!
reply

Hi, sorry to be a pain, but when I try to import Matplotlib, it gives me an error, DLL load failed while importing ft2font
Can someone pls help me.
Edit: is there any fix?

reply

I usually dont comment but today your course has made me comment, Really it was a very good course learned a lot. KEEP IT UP DON'T STOP!!!!!!!!!!!!!!!!!!!!!!!!!!
reply

4:11 alternatively you can also use plt.plot(); # use ; to not make to show that matplotlib object creation at certain memory location.
reply
Add a review, comment






Other channel videos