0% found this document useful (0 votes)
46 views

Data Visualization: Dr. P. Getzi Jeba Assistant Professor / CSE

The document discusses five key types of data visualization plots: line plots, bar charts, histograms, box and whisker plots, and scatter plots. Examples of each type of plot are provided and explained.

Uploaded by

Vivashwanth Pai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views

Data Visualization: Dr. P. Getzi Jeba Assistant Professor / CSE

The document discusses five key types of data visualization plots: line plots, bar charts, histograms, box and whisker plots, and scatter plots. Examples of each type of plot are provided and explained.

Uploaded by

Vivashwanth Pai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

DATA VISUALIZATION

Dr. P. Getzi Jeba


Assistant Professor / CSE
TYPES OF VISUALIZATION

There are five key plots in data visualization. They are:

• Line Plot
• Bar Chart
• Histogram Plot
• Box and Whisker Plot
• Scatter Plot
LINE PLOT
A line plot is generally used to present observations collected at regular intervals.

from numpy import sin


from matplotlib import pyplot
# consistent interval for x-axis
x = [x*0.1 for x in range(100)]
# function of x for y-axis
y = sin(x)
# create line plot
pyplot.plot(x, y)
# show line plot
pyplot.show()
BAR CHART
A bar chart is generally used to present relative quantities for multiple categories.

from random import seed


from random import randint
from matplotlib import pyplot
# seed the random number generator
seed(1)
# names for categories
x = ['red', 'green', 'blue']
# quantities for each category
y = [randint(0, 100), randint(0, 100), randint(0, 100)]
# create bar chart
pyplot.bar(x, y)
# show line plot
pyplot.show()
HISTOGRAM
A histogram plot is generally used to summarize the distribution of a data sample.

# example of a histogram plot


from numpy.random import seed
from numpy.random import randn
from matplotlib import pyplot
# seed the random number generator
seed(1)
# random numbers drawn from a Gaussian distribution
x = randn(1000)
# create histogram plot
pyplot.hist(x)
# show line plot
pyplot.show()
BOX PLOT vs HOSTOGRAM
BOX PLOT vs HOSTOGRAM

• Histograms are used to show distributions of variables while bar charts are used to
compare variables.

• Histograms plot quantitative data with ranges of the data grouped into bins or intervals
while bar charts plot categorical data.
• Bars can be reordered in bar charts but not in histograms.
BOX or WHISKER PLOT
• A box and whisker plot, or boxplot for short, is generally used to summarize the
distribution of a data sample.
• Box plots show the five-number summary of a set of data: including the minimum score,
first (lower) quartile, median, third (upper) quartile, and maximum score.
BOX or WHISKER PLOT
BOX or WHISKER PLOT
BOX or WHISKER PLOT
A box and whisker plot, or boxplot for short, is generally used to summarize the distribution of
a data sample.

# example of a box and whisker plot


from numpy.random import seed
from numpy.random import randn
from matplotlib import pyplot
# seed the random number generator
seed(1)
# random numbers drawn from a Gaussian distribution
x = [randn(1000), 5 * randn(1000), 10 * randn(1000)]
# create box and whisker plot
pyplot.boxplot(x)
# show line plot
pyplot.show()
SCATTER PLOT
A scatter plot (or ‘scatterplot’) is generally used to summarize the relationship between two
paired data samples.

from numpy.random import seed


from numpy.random import randn
from matplotlib import pyplot
# seed the random number generator
seed(1)
# first variable
x = 20 * randn(1000) + 100
# second variable
y = x + (10 * randn(1000) + 50)
# create scatter plot
pyplot.scatter(x, y, )
# show line plot
pyplot.show()

You might also like