Matplotlib Tutorial 4 - Bar Chart

  Рет қаралды 149,689

codebasics

codebasics

Күн бұрын

Пікірлер: 95
@codebasics
@codebasics 2 жыл бұрын
Do you want to learn technology from me? Check codebasics.io/ for my affordable video courses
@rancher16
@rancher16 2 жыл бұрын
Unable to get matplotlib pyplot documentation
@tauhidanwar3512
@tauhidanwar3512 4 жыл бұрын
i also changed the width in barh same like in vertical bar. It's little bit different to do in barh. The width in barh is actually height. So to change the width in barh, we have to change the value of height= 0.4 This one thing i learned out from this video with my own research from internet. Thanks sir for the amazing tutorials over the data science.
@armagaan007
@armagaan007 6 жыл бұрын
Amazon is a weird company 😂😂 Love your videos They are neither too long nor too short and deliver everything at a good pace. Thanks a lot (You are great at explaining)
@muvvalavenkataaravindasatv2131
@muvvalavenkataaravindasatv2131 3 жыл бұрын
To avoid overlapping while plotting the bar graph horizontally, use height=0.4
@afeezyusuf8469
@afeezyusuf8469 2 жыл бұрын
Thanks very helpful
@mailrafat
@mailrafat 4 жыл бұрын
the most helpful bar vid for matplotlib
@codebasics
@codebasics 4 жыл бұрын
Thanks rafat.
@astridhaugland
@astridhaugland 6 жыл бұрын
Excellent tutorial!
@subratkumarsahoo4849
@subratkumarsahoo4849 6 жыл бұрын
we can directly plot the bar chart with company and revenue plt.bar(company,revenue) it works.
@debashissahoo5031
@debashissahoo5031 6 жыл бұрын
Can we put side by side bar chart by this way? If we try the below steps, it's only coming a stacked bar chart. plt.bar(company,revenue, label='Revenue') plt.bar(company,profit, label='Profit')
@debashissahoo5031
@debashissahoo5031 6 жыл бұрын
thank you sir @codebasics
@deojeetsarkar2006
@deojeetsarkar2006 5 жыл бұрын
No my friend no sks, int,str problem arises all the time.
@harshavardhanreddy7063
@harshavardhanreddy7063 5 жыл бұрын
@@deojeetsarkar2006 It worked for me
@jumpropemonk7703
@jumpropemonk7703 4 жыл бұрын
It worked for me too and I managed to avoid the importing np
@ILiveOnTheSun
@ILiveOnTheSun 4 жыл бұрын
Thank you so much for making such great videos on matplotlib. It was really really really helpful.😃
@codebasics
@codebasics 4 жыл бұрын
👍😊
@claudiagomes1104
@claudiagomes1104 3 жыл бұрын
thank you so so so soooooo much, you saved my life
@vedantdivanji2769
@vedantdivanji2769 5 жыл бұрын
Ur videos are amazing. Love the way you teach concepts. I would be happy if you could make a tutorial on Seaborn too.
@codebasics
@codebasics 5 жыл бұрын
Sure vedant. I will note down this topic and get to it in future
@karanpadda
@karanpadda 3 жыл бұрын
@@codebasics Why do we use figure and Axis? , do you have video ?
@HashWithHarish
@HashWithHarish Жыл бұрын
Can someone help me to understand why did sir remove width @ 7:37
@rifqimatondang
@rifqimatondang 4 жыл бұрын
Thank you very much! this helped my college assignment :D
@codebasics
@codebasics 4 жыл бұрын
Glad it helped!
@abarth0800
@abarth0800 5 жыл бұрын
Good work, straight to the points!
@codebasics
@codebasics 5 жыл бұрын
Thanks for the appreciation David.
@ankitkumarsingh3717
@ankitkumarsingh3717 6 жыл бұрын
why do we need xticks function if we can directly pass company string as an argument in bar function. great tutorial though!
@TusharSinghmetal
@TusharSinghmetal 4 жыл бұрын
It makes sure that you stick to the current axis. If you didn't get it do check this link(www.tutorialspoint.com/matplotlib/matplotlib_setting_ticks_and_tick_labels.htm) This might help you!
@reginakuai7307
@reginakuai7307 4 жыл бұрын
@@TusharSinghmetal .aimlessly
@TusharSinghmetal
@TusharSinghmetal 4 жыл бұрын
@@reginakuai7307 if u have better idea please share it
@ProfitScalpKing1
@ProfitScalpKing1 7 жыл бұрын
Great Video!
@okamibeats7716
@okamibeats7716 3 жыл бұрын
how do i change the bar color for every company? as i want to do this with my own data like that
@vedanthbaliga7686
@vedanthbaliga7686 4 жыл бұрын
It is such a tedious task to create histograms and bar plots in Matplotlib! I would prefer Seaborn any day over Matplotlib🙂
@harshalbhoir8986
@harshalbhoir8986 2 жыл бұрын
Thank you so much!!!
@HashWithHarish
@HashWithHarish Жыл бұрын
Can you help me to understand why did sir remove width @ 7:37
@AKSHAY99552
@AKSHAY99552 3 жыл бұрын
worked for horizontal side by side bars plt.barh(xpos-0.2,revenue,height=0.4,label='Revenue') plt.barh(xpos+0.2,profit,height=0.4,label='Profit')
@km-ss7st
@km-ss7st 6 жыл бұрын
thank you very much teacher!
@flamboyantperson5936
@flamboyantperson5936 6 жыл бұрын
Great one
@MissTexZilla
@MissTexZilla 5 жыл бұрын
Thank you for explaining xticks
@codebasics
@codebasics 5 жыл бұрын
My pleasure Kris. Thanks for the comment 😊
@vinayaksharma-ys3ip
@vinayaksharma-ys3ip 3 жыл бұрын
Thank You Sir so much!!
@Sumit_S
@Sumit_S 5 жыл бұрын
Hi i have a question , suppose on x axis we have labels that are too long and they are appending on each other and are not visible properly , so how can we provide space between the xlabels
@KK-pf1ye
@KK-pf1ye 2 жыл бұрын
Thank you!
@ashleypursell9702
@ashleypursell9702 4 жыл бұрын
awesome video thanks so much
@codebasics
@codebasics 4 жыл бұрын
Glad you liked it!
@sanjaykrish8719
@sanjaykrish8719 7 жыл бұрын
Very good video.. Thanks
@eashansoni3761
@eashansoni3761 6 жыл бұрын
Good tutorial. To answer your question about why Amazon's profits are so low, it's because Amazon cares much more about the long-term than the short-term. So they will buy a lot of companies and invest in lots of new technologies which decrease their profits, but they expect these purchases and investments to pay off later on. Also, Amazon is one of the few companies that care more about advancing civilization rather than simply making a profit, and Amazon's profits are simply a means to that goal. Hope that answered your question.
@ASNPersonal
@ASNPersonal 4 жыл бұрын
Thank you for explaining xticks & side by side graphs. What is the importance of %matplotlib inline?
@balaji9629
@balaji9629 3 жыл бұрын
To get graph next to the cell
@veda5619
@veda5619 4 жыл бұрын
Nice , thank you
@codebasics
@codebasics 4 жыл бұрын
Welcome 😊
@tsukishima123
@tsukishima123 4 жыл бұрын
if you take repeated values for example in company does the revenue get averaged or summed up
@juandavidlozadacalderon1356
@juandavidlozadacalderon1356 4 жыл бұрын
Thanks friend.
@arban451
@arban451 4 жыл бұрын
Thank you sir for this thank you really
@soccerclub4417
@soccerclub4417 4 жыл бұрын
The last example output: plt.yticks(xpos,company) plt.xlabel("Revenue(BN)") plt.title("US TECH STOCK") plt.barh(xpos-0.2,revenue,height=0.4,label="Revenue") plt.barh(xpos+0.2,profit,height=0.4,label="Profit") plt.legend()
@sadhnajain1374
@sadhnajain1374 4 жыл бұрын
Error is coming that name 'profit' is not defined when I write plt.bar(ypos,profit,label="Profit") but I've defined profit= [40,2,34,12] same as your code please help me with this
@itzikovadia851
@itzikovadia851 4 жыл бұрын
xticks is unnecessary and it is not working for me. instead as the guys suggestion i put plt.bar(company,revenuge) and it is working thanks a lot Sir
@faisalqureshi7145
@faisalqureshi7145 3 жыл бұрын
How to Show a value on the bar in Matplotlib and seaborn?
@urvishshah570
@urvishshah570 6 жыл бұрын
You have not define ypos.How the error not coming? Kindly check it
@codebasics
@codebasics 6 жыл бұрын
In python you dont need to explicitly declare a variable before using it. So this code is correct, ypos = np.arange(len(company))
@nishushroff9656
@nishushroff9656 3 жыл бұрын
How to get the sample project
@shaikhkashif9973
@shaikhkashif9973 2 жыл бұрын
Bar plot is univariate, yes so why u are using as 2 variables inside it
@alakhpandey.shorts
@alakhpandey.shorts 2 жыл бұрын
Your voice looks like one of the my classmates
@ranchhordaschaanchad2623
@ranchhordaschaanchad2623 7 ай бұрын
great listening your text!
@sejalanand23
@sejalanand23 3 жыл бұрын
I figured out an easier way to do side-by-side charts. plt.subplots(figsize=(width,height)) # to change size of subplots plt.subplot(total no of rows, total no of columns, plot #) plt.bar(x,y) plt.tight_layout() for space between plots
@sandipghosh5714
@sandipghosh5714 Жыл бұрын
plt.bar(company, revenue) is working on my computer
@HashWithHarish
@HashWithHarish Жыл бұрын
Can you help me to understand why did sir remove width @ 7:37
@sandipghosh5714
@sandipghosh5714 Жыл бұрын
​@@HashWithHarishwell you can experiment with that, you can see by removing or by not removing, what are the end results, try it out, you will find it informative
@Yourxway
@Yourxway Жыл бұрын
its working for me too, idk why no one is talking about it, maybe they updated this feature in some new version of matplotlib as this video is 4 years old
@heeramani7463
@heeramani7463 4 жыл бұрын
plz increase fontsize...
@codebasics
@codebasics 4 жыл бұрын
point noted.
@vamsisaggurthi5528
@vamsisaggurthi5528 6 жыл бұрын
Good
@yanyupan
@yanyupan 5 жыл бұрын
"I never understood Amazon" ,,,,,,,,hahaha
@codebasics
@codebasics 5 жыл бұрын
Isn't that true , ha ha 😂
@CE-vd2px
@CE-vd2px 4 жыл бұрын
@@codebasics Theyre going for the monopoly and likely government sponsored
@shrutijain1628
@shrutijain1628 4 жыл бұрын
💯💯
@jimmychangtiunnkunui7877
@jimmychangtiunnkunui7877 Жыл бұрын
"Amazon is a weird company.They don't generate any profit." lol
@shivagolla5152
@shivagolla5152 4 жыл бұрын
I am getting an error while giving a label to axis plt.xlabel('Company') plt.ylabel('Revenue') Error: String object is not callable. Anyone with the same error? Did you get that right? please help me out!
@codebasics
@codebasics 4 жыл бұрын
Look like just before .xlabel call plt seems to have string in it.
@MrPrudhvisai
@MrPrudhvisai 4 жыл бұрын
all this can be done in one shot using data frame i guess df.plot(kind='bar')
@deojeetsarkar2006
@deojeetsarkar2006 5 жыл бұрын
Ore gajaab, sentdex, corey jo ny bataya wo tum bataya.
@codebasics
@codebasics 5 жыл бұрын
Wow thanks for your kind words of appreciation deojeet 😀👍
@jumpropemonk7703
@jumpropemonk7703 4 жыл бұрын
Tableau and Power BI would have finish the same time in no time. Cool tutorial though
@yagamilul4479
@yagamilul4479 Жыл бұрын
my indian guy
@spiralni
@spiralni 3 жыл бұрын
why to use xticks? plt.bar(company, revenues) will do the trick
@HashWithHarish
@HashWithHarish Жыл бұрын
Its because that if we use your approach then we can't separate revenue and profit bar from each other, so for doing that we need to use numpy approach and for that we have to use xticks
@siddharthjain8310
@siddharthjain8310 6 жыл бұрын
Content is good. But please correct your pronunciation of "legend"
@giannipancho
@giannipancho 3 жыл бұрын
easier, y="axis you want"
@spiderjerusalem
@spiderjerusalem 5 жыл бұрын
I never understand Amazon either...
@hoganbrinson6798
@hoganbrinson6798 4 жыл бұрын
Great video!
Matplotlib Tutorial 5 - Histograms
8:19
codebasics
Рет қаралды 118 М.
How To Make Your Matplotlib Bar Charts Stand Out
19:59
Andy McDonald
Рет қаралды 2,7 М.
Леон киллер и Оля Полякова 😹
00:42
Канал Смеха
Рет қаралды 4,7 МЛН
Matplotlib Tutorial (Part 4): Stack Plots
14:49
Corey Schafer
Рет қаралды 112 М.
Multiple Bar Chart | Grouped Bar Graph | Matplotlib | Python Tutorials
15:45
Matplotlib Tutorial 3   bar charts and histograms
11:20
sentdex
Рет қаралды 267 М.
Stanford's FREE data science book and course are the best yet
4:52
Python Programmer
Рет қаралды 715 М.
Python Pie Chart in Hindi
6:57
Simply Coding
Рет қаралды 4,6 М.
Matplotlib Crash Course
1:31:41
freeCodeCamp.org
Рет қаралды 352 М.
Learn Machine Learning Like a GENIUS and Not Waste Time
15:03
Infinite Codes
Рет қаралды 404 М.
Matplotlib Tutorial (Part 3): Pie Charts
17:02
Corey Schafer
Рет қаралды 162 М.