Matplotlib
Matplotlib
In Python
Matplotlib: Visualization with Python
Legend
#invoking Grid Function
Bar Chart
# the Values are in strings and the
program will not read string values for
bar diagram. So first we need to make
this values into numerical values.
Legend
To plot Two different measures. (Revenue and
Profit)
• company=['RIL',’FLPKT','WIPRO','TCS']
• revenue=[170,96,109,147]
• profit=[100,42,74,112]
By this way we can understand the real revenue and the actual
profit of the company.
Here this chart is bit confusing.
An ordinary person cant
understand anything from
such a type of chart. To easily
understand the chant the
values should be brought side-
by-side. Using the codes in the
next slide.
#Here we reduce and add 0.2 from
revenue and profit respectively and
give equal with to both the variables
2 Pre-diabetic
# by default number of bins is set to 10
# Only one
set of values
is enough for
histogram
# the labels are assigned
# the bins
numbers are
assigned based
on the need to
determine the
Diabetic, Pre-
diabetic and
Non-Diabetic
patients
#To draw the histogram for
2 datasets
# explode
function is to
bring a piece of pie
out.
# ‘startangle’ can be
used to rotate the
pie. It mentions at
what angle the first
value should start.