*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
Much better than lots of those paid courses out there! Lean, clean and straightforward! Thanks a lot and please please record more videos on other data Science and python related topics in the same manner you did this course!
i cant believe this is free of charge......thank you so much!!!!!!!!!!!!!!!!! i have also watched your numpy and pandas tutorials and enjoyed them very much!!! thank you for doing this, you are making such a difference.
plt.figure(figsize = (12,7)) for c in gas.columns[1:]: plt.plot(gas['Year'] , gas[c] , label=c , marker='.')
plt.legend() plt.show() This worked for me while plotting the line graph for all countries! (Note : Include the import statements and read the csv first, haven't included that here.) Thank you for the tutorial! This channel is basically where I have started picking up things.
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!
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!!!!!!!!!!!!!!!!!!!!!!!!!!
For the people who are following this in 2024, and not getting the country names automatically after using for loop just add label=country in plot arguments like this: for country in gas: if country != 'Year': plt.plot(gas.Year, gas[country], label=country)
Could you go through the iplot function from matplotlib, too (it’s basically a plotting function that makes interactive plots) and go through candle stick plots? (iplot plots 3d as well as 2d, so please go over iplot 3d as well iplot 2d if you can)
At 45:40, with the for loop, why does it automatically iterate over the headings and not the values under those headings. Is it because pandas saves the CSV file as a dictionary-like structure with the headings as keys. And these are automatically iterated over in a for loop? At 1:12:00, how do you not get an error when the condition checks if the entry is less than an integer, when not all of the values under the heading weight will have been converted to integers in the previous code (ie the code "else x" doesn't necessarily give an integer in the list comprehension). At 1:22:10, why aren't the arguments for the boxplot barcelona[1] and madrid[1] rather than barcelona and madrid. Since barcelona and madrid seem to be 2D arrays and not 1D arrays.
I thought the bar trick with around 30:00 is really cool. The One for the for loop. However, I `m not sure what the "pop" functionality is . Does anyone knows?
pop(0) chooses the first element in the list and removes it from the list. So the next first element after '/' is removed will be 'o'. If this explanation is unclear, do let me know.
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.'
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.
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?
Hi I asked a similar question. I think it's because the for loop iterates over the headings (the countries) of the CSV file (so countries in the code "for countries in" will refer to these headings). It iterates over these headings (and not over the rows of the table) since the headings are the keys of the dictionary-like structure gas. That's my understanding.
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?
You can install the fonts on your system and your notebook will pick them up. Ananconda does not actually install fonts, but rather uses the fonts available system-wide.
legend() did not make labels when putting it in 40:00 , this is probably google colab thing, if using pycharm like me , then must do it manually b adding label to each just like in 40:30 for legends in loop=> for country in gas: if country != 'Year': # to avoid year showing up too. plt.plot(gas.Year, gas[country], marker='.', label= country )
Hi! I've been trying to follow your steps but I got an error, I wonder if it is due to the Phyton or matplotlib version: countries_to_analyze=['Mexico','USA','Canada','Japan'] for country in gas: if country in countries_to_analyze: plt.plot(gas.Year,gas[country], marker='.',label=country) plt.xticks(gas.Year[::3]) plt.legend() plt.show() TypeError Traceback (most recent call last) Cell In[131], line 6 3 if country in countries_to_analyze: 4 plt.plot(gas.Year,gas[country], marker='.',label=country) ----> 6 plt.xticks(gas.Year[::3]) 7 plt.legend() 8 plt.show() TypeError: 'list' object is not callable Any help would be so appreciated, take care, Jesus
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?
I want to read the fifa_data.csv with pd. read....... But it shows me errors like '' no such file or directory: 'fifa_data.csv'. I downloaded pandas. I don't know what to do. Please somebody could help me?
"Let's just jump into it" = immediate upvote
Philly D :)
Why you called it upvote man 😭😭😭 now I think your a neck beard
The best thing about this tutorial is that he keeps the mistakes made.
*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
Lei Xun Thanks for sharing
Thanks
@@aarushgoyal You are welcome
Super helpful !! Thank you for this :)
@@awesomekalyana15 You are welcome!
Much better than lots of those paid courses out there! Lean, clean and straightforward! Thanks a lot and please please record more videos on other data Science and python related topics in the same manner you did this course!
That guy is an MIT graduate hahaha
real talk
i cant believe this is free of charge......thank you so much!!!!!!!!!!!!!!!!! i have also watched your numpy and pandas tutorials and enjoyed them very much!!! thank you for doing this, you are making such a difference.
plt.figure(figsize = (12,7))
for c in gas.columns[1:]:
plt.plot(gas['Year'] , gas[c] , label=c , marker='.')
plt.legend()
plt.show()
This worked for me while plotting the line graph for all countries!
(Note : Include the import statements and read the csv first, haven't included that here.)
Thank you for the tutorial! This channel is basically where I have started picking up things.
I think keeping documentation window open was such a great advice. My struggles with matplotlib have gone down once I Put that tip in practice.
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!
Wow ! It's a superb course ! I learnt tons of things ! Also, at 59:00, you can use log=True option to make y log scale
You're doing great ! Carry on !
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!!!!!!!!!!!!!!!!!!!!!!!!!!
Python contour animation
ruclips.net/video/ZFQwwxyKG_U/видео.html
Thank you, Highly appreciate... most important thing is, this is free for every one.. this course much better than paid courses...
Okay, it took me a lot of time to complete numpy, pandas and matplotlib from you keith, but I think it was worth it. Although, I remember NULL.
Very quick, clear and concise highly recommended
Great teacher you are man. I have watched all your data visualization videos they all are amazing...
Great introductory course to Matplotlib.
8:22 🤪
Anyways, thanks for making the tutorial. It's a very helpful tutorial for us 😁
lol
t and k are so far apart in the alphabet 🤨
exactly what I was about to start. Thank you.
4:11 alternatively you can also use plt.plot(); # use ; to not make to show that matplotlib object creation at certain memory location.
Thank you so much for your great tutorials. Can you do a tutorial on tableau please?
Thank you very much for your wonderful teaching and real-world example. Nice course for learning.
40:00 why this code worked is hilarious
For the people who are following this in 2024, and not getting the country names automatically after using for loop
just add label=country in plot arguments like this:
for country in gas:
if country != 'Year':
plt.plot(gas.Year, gas[country], label=country)
40:15 'How it worked' 🤣🤣. Sometimes we coders don't know what actually happened but that finally works
yeah bro even i got error for that🤣
A very beautiful representation of Matplotlib
More MatPlotLib courses!
at min 4:34 you can just write plt.plot(x,y); instead of plt.show() ; is enough, thanks for tutorial
8:20 What was that bro?
Galli is such a dope dude. thanks.
Thanks a lot Keith, very crisp explanation!
Yoooooo..... waiting for such a course
thanks for amazing explanation. sir please make a video on Scipy.
Great tutorial
This was very useful, thank you!
Could you go through the iplot function from matplotlib, too (it’s basically a plotting function that makes interactive plots) and go through candle stick plots? (iplot plots 3d as well as 2d, so please go over iplot 3d as well iplot 2d if you can)
Thank you so much for your great tutorials.
i really like your course keep it up sir
At 45:40, with the for loop, why does it automatically iterate over the headings and not the values under those headings. Is it because pandas saves the CSV file as a dictionary-like structure with the headings as keys. And these are automatically iterated over in a for loop?
At 1:12:00, how do you not get an error when the condition checks if the entry is less than an integer, when not all of the values under the heading weight will have been converted to integers in the previous code (ie the code "else x" doesn't necessarily give an integer in the list comprehension).
At 1:22:10, why aren't the arguments for the boxplot barcelona[1] and madrid[1] rather than barcelona and madrid. Since barcelona and madrid seem to be 2D arrays and not 1D arrays.
Thank you Keith :)
Nice one and keep it up!
Very well explained! Thank you very much! 💛
excellent as always.
Great video - nice one. Thanks.
brilliant tutorial
I thought the bar trick with around 30:00 is really cool. The One for the for loop. However, I `m not sure what the "pop" functionality is . Does anyone knows?
pop(0) chooses the first element in the list and removes it from the list. So the next first element after '/' is removed will be 'o'. If this explanation is unclear, do let me know.
thank you so much man .much appreciated
😍😍😍 will you make a video for pandas and numpy too? 👀
Try this one: ruclips.net/video/r-uOLxNrNk8/видео.html
I was floored by that yel joke. Hahaha
Awesome!!! TQVM!!
1:00:00 How do I use the bar_label function to this histogram? I always the error "AttributeError: 'tuple' object has no attribute 'patches'"
Thanks Keith
thanks man, very throroughly !
I learnt pandas with this guy #respect
You did a really good job on this. I like how you motivate what you're showing. Great stuff.
In the first example 46:45 i am not able to get the legend when for loop is run. Can someone please help me with that
Can you kindly post a link to your Pandas crash course video? Thank you.
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.'
plt.plot(gas.Year, gas[country], label=country, marker=".")
then outside the loop: plt.legend()
@@nikhiljagtap1669 thank you
thanks for this beautiful video love from india
i wish Coursera courses were this short and brief.
Love your videos they help me a lot.
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.
40:29 matplotlib showed no handles with labels found to put in legend? can anyone tell me why it is not working
just put label='country_name' argument in every plot function then use legend function
this is gold !
How to comment three lines together? Check 30:16
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?
Nice explanation. Can you please tell me what that for loop is doing and how it will identify the country in gas?
Hi I asked a similar question. I think it's because the for loop iterates over the headings (the countries) of the CSV file (so countries in the code "for countries in" will refer to these headings). It iterates over these headings (and not over the rows of the table) since the headings are the keys of the dictionary-like structure gas. That's my understanding.
Amazing Thanks a lot
Thanks a lot!
this guy very good
Could you have iterated through the countries using gas.columns[1:] ?
Yes Sir
good stuff
How about a 4D plot with matplotlib?
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?
You can install the fonts on your system and your notebook will pick them up.
Ananconda does not actually install fonts, but rather uses the fonts available system-wide.
@@pewolo Thanks! :)
My G!!!
Thanks pal
legend() did not make labels when putting it in 40:00 , this is probably google colab thing, if using pycharm like me , then must do it manually b adding label to each just like in 40:30
for legends in loop=>
for country in gas:
if country != 'Year': # to avoid year showing up too.
plt.plot(gas.Year, gas[country], marker='.', label= country )
26:30, let one rip eh?
😂😂😂😂
great vid
Nice!
Thanks a lot
i was waiting for this video ..... anyway can i use Pycharm ?
Well it's really late but if you still dont know yes
no if using for datascience purpose
So Good
quick question, do you need to know numpy and pandas to learn matplotlib?
Thanks🤩
Thank you
please share your panadas video link also ,i am not able to find it
Nice
Please make a video on matplotlib animations...
Hi! I've been trying to follow your steps but I got an error, I wonder if it is due to the Phyton or matplotlib version:
countries_to_analyze=['Mexico','USA','Canada','Japan']
for country in gas:
if country in countries_to_analyze:
plt.plot(gas.Year,gas[country], marker='.',label=country)
plt.xticks(gas.Year[::3])
plt.legend()
plt.show()
TypeError Traceback (most recent call last)
Cell In[131], line 6
3 if country in countries_to_analyze:
4 plt.plot(gas.Year,gas[country], marker='.',label=country)
----> 6 plt.xticks(gas.Year[::3])
7 plt.legend()
8 plt.show()
TypeError: 'list' object is not callable
Any help would be so appreciated, take care, Jesus
33:05 more more
can someone recommend to me a good video for 3D and higher dimensional graphs
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?
pip install matplotlib or download anaconda that way you don't have install matplotlib.
How did you add # to many lines at the same time? (newbie here)
Select lines and ctrl + /
@@mlmigdalsky4316 thanks a lot sir!
I have a question please ... Do I need to learn numpy or pandas before I can start freelancing with matplotlib ?
Yes, They are inter-related
Phyton trorial about data sciences on data backup
I want to read the fifa_data.csv with pd. read....... But it shows me errors like '' no such file or directory: 'fifa_data.csv'. I downloaded pandas.
I don't know what to do. Please somebody could help me?
I've found a tutorial on RUclips for the problem.
0:09:57 ohhhhh my goshhhh!!!!!! XD
Is matplotlib an engineering programm cause am studying electrical engineering though ......?????
Can anyone share the official documentation link here
6:43
31:38