COURSES
MBAData Science & AnalyticsDoctorate Software & Tech AI | ML MarketingManagement
Professional Certificate Programme in HR Management and AnalyticsPost Graduate Certificate in Product ManagementExecutive Post Graduate Program in Healthcare ManagementExecutive PG Programme in Human Resource ManagementMBA in International Finance (integrated with ACCA, UK)Global Master Certificate in Integrated Supply Chain ManagementAdvanced General Management ProgramManagement EssentialsLeadership and Management in New Age BusinessProduct Management Online Certificate ProgramStrategic Human Resources Leadership Cornell Certificate ProgramHuman Resources Management Certificate Program for Indian ExecutivesGlobal Professional Certificate in Effective Leadership and ManagementCSM® Certification TrainingCSPO® Certification TrainingLeading SAFe® 5.1 Training (SAFe® Agilist Certification)SAFe® 5.1 POPM CertificationSAFe® 5.1 Scrum Master Certification (SSM)Implementing SAFe® 5.1 with SPC CertificationSAFe® 5 Release Train Engineer (RTE) CertificationPMP® Certification TrainingPRINCE2® Foundation and Practitioner Certification
Law
Job Linked
Bootcamps
Study Abroad
Master of Business Administration (90 ECTS)Master in International Management (120 ECTS)Bachelor of Business Administration (180 ECTS)B.Sc. Computer Science (180 ECTS)MS in Data AnalyticsMS in Project ManagementMS in Information TechnologyMasters Degree in Data Analytics and VisualizationMasters Degree in Artificial IntelligenceMBS in Entrepreneurship and MarketingMSc in Data AnalyticsMS in Data AnalyticsMS in Computer ScienceMaster of Science in Business AnalyticsMaster of Business Administration MS in Data ScienceMS in Information TechnologyMaster of Business AdministrationMS in Applied Data ScienceMaster of Business Administration | STEMMS in Data AnalyticsM.Sc. Data Science (60 ECTS)Master of Business AdministrationMS in Information Technology and Administrative Management MS in Computer Science Master of Business Administration MBA General Management-90 ECTSMSc International Business ManagementMS Data Science Master of Business Administration MSc Business Intelligence and Data ScienceMS Data Analytics MS in Management Information SystemsMSc International Business and ManagementMS Engineering ManagementMS in Machine Learning EngineeringMS in Engineering ManagementMSc Data EngineeringMSc Artificial Intelligence EngineeringMPS in InformaticsMPS in Applied Machine IntelligenceMS in Project ManagementMPS in AnalyticsMS in Project ManagementMS in Organizational LeadershipMPS in Analytics - NEU CanadaMBA with specializationMPS in Informatics - NEU Canada Master in Business AdministrationMS in Digital Marketing and MediaMS in Project ManagementMSc Sustainable Tourism and Event ManagementMSc in Circular Economy and Sustainable InnovationMSc in Impact Finance and Fintech ManagementMS Computer ScienceMS in Applied StatisticsMaster in Computer Information SystemsMBA in Technology, Innovation and EntrepreneurshipMSc Data Science with Work PlacementMSc Global Business Management with Work Placement MBA with Work PlacementMS in Robotics and Autonomous SystemsMS in Civil EngineeringMS in Internet of ThingsMSc International Logistics and Supply Chain ManagementMBA- Business InformaticsMSc International ManagementMBA in Strategic Data Driven ManagementMSc Digital MarketingMBA Business and MarketingMaster of Business AdministrationMSc Digital MarketingMSc in Sustainable Luxury and Creative IndustriesMSc in Sustainable Global Supply Chain ManagementMSc in International Corporate FinanceMSc Digital Business Analytics MSc in International HospitalityMSc Luxury and Innovation ManagementMaster of Business Administration-International Business ManagementMS in Computer EngineeringMS in Industrial and Systems EngineeringMSc International Business ManagementMaster in ManagementMSc MarketingMSc Business ManagementMSc Global Supply Chain ManagementMS in Information Systems and Technology with Business Intelligence and Analytics ConcentrationMSc Corporate FinanceMSc Data Analytics for BusinessMaster of Business AdministrationBachelors in International ManagementMS Computer Science with Artificial Intelligence and Machine Learning ConcentrationMaster of Business AdministrationMaster of Business AdministrationMSc in International FinanceMSc in International Management and Global LeadershipMaster of Business AdministrationBachelor of Business
For College Students

Visualisation: Bar Graph in Python Matplotlib

$$/$$

Plots are used to convey different ideas. For example, using some plots, you may want to visualise the spread of data across two variables. With some others, you may want to gauge the frequency of a certain label. Depending on the objective of your visualisation task, you will choose an appropriate plot. As part of this session, you will learn to do the same.
 

Let’s get started with the first plot, namely, a Bar Graph.

$$/$$

You will be using the subpackage pyplot to build plots and graphs throughout this session. To load the subpackage, you need to run the following command:

 

import matplotlib.pyplot as plt

 

To recap, Matplotlib allows you to use a simple and intuitive workflow to create plots. Here are the important Matplotlib commands that you learnt in the video:

  • plt.show(): Explicit command required to display the plot object
  • plt.bar(x_component, y_component): Used to draw a bar graph


A bar graph is helpful when you have to visualise a numeric feature (fact) across multiple categories. In the example discussed above, you plotted the sales amount (numeric feature) under three different product categories. Using the plot, you could easily distinguish the performance of each category.

Bar Graph
$$/$$

Let us now learn to add elements to our graph to make it more understandable.

$$/$$

You can use the following codes to add a title and labels to your graph:

  • plt.xlabel(), plt.ylabel(): Specify labels for the x and y axes
  • plt.title(): Add a title to the plot object

You can also try to make the charts more appealing by using different attributes like font size, colour, etc. Adding labels and a title helps a person to interpret the graphs presented better and relays the required information to the viewer. 

 

Let us now learn how to change the colour of the bars that represent our data.

$$/$$

Using the attributes of plt.bar(), you can make the desired changes in the bars of the graph. Till now, we have learnt how to add a title and labels to the axes and change the colour of a bar. The element that remains to be learnt is the ticks or marks on the axes. Let’s learn about the features that matplotlib offers with regard to this.

$$/$$

You can use the following code to change the values and ticks on the x and y axes of a graph:

plt.yticks(tick_values, tick_labels)

 

You can specify the tick values and the label easily through a list or an array. 

$$/$$

Having understood the concepts covered in this segment, you are now familiar with how to build a bar graph and add or modify the required elements within it. In the next segment, you will learn about the another visualisation, namely, a Scatterplot.