Chapter – 4 Plotting Data Using Matplotlib

Multiple Choice Question

1. A graphical display of data using bars of different heights is called ____________.
(a) Bar Chart
(b) Bar Graph
(c) Line Chart
(d) Line Graph

2. The graphical or visual representation of information and data using visual elements like charts, graphs, and maps etc are knows as ___________.
(a) Bar Chart
(b) Bar Graph
(c) Data Visualization
(d) Line Graph

3. A type of chart which displays information as a series of data points called ‘markers’ connected by straight line segments
(a) Bar Chart
(b) Bar Graph
(c) Line Chart
(d) Line Graph

4. Graph of plotted points on two axes that show the relationship between two sets of data.
(a) Line Chart
(b) Line Graph
(c) Scatter Chart
(d) Pie Chart

5. A type of graph in which a circle is divided into sectors that each represent a proportion of the whole.
(a) Line Chart
(b) Line Graph
(c) Scatter Chart
(d) Pie Chart

6. A summarization tool for discrete or continuous data.
(a) Line Chart
(b) Histogram
(c) Scatter Chart
(d) Pie Chart

7. A type of frequency distribution graph is _________
(a) Frequency Polygon
(b) Histogram
(c) Scatter Chart
(d) Pie Chart

8. The visual representation of the statistical five number summary of a given data set
(a) Box plot
(b) Histogram
(c) Scatter Chart
(d) Pie Chart

 

Answer the Following

Q1. What is Data Visualization ? What is its Significance?
Solution :- Data visualization is a general term that describes any effort to help people understand the significance of data by placing it in a visual context. In simple words, Data visualization is theprocess of displaying data/information in graphical charts, figures and bars.
Patterns, trends and correlations that might go undetected in text-based data can be exposed and recognized easier with data visualization techniques or tools such as line chart, bar chart, pie chart, histogram, scatter chart etc. Thus with data visualization tools, information can be processed in efficient manner and hence better decisions can be made.

Q.2 What is Python’s support for Data visualization ?
Solution:- Python supports data visualizations by providing some useful libraries for visualization. Most commonly used data visualization library is matplotlib.
Matplotlib is a Python library, also sometimes known as the plotting library. The matplotlib library offers very extensive range of 2D plot types and output formats. It offers complete 2D support along with limited 3D graphic support. It is useful in producing publication quality figures in interactive environment across platforms. It can also be used for animations as well. There are many other libraries of Python that can be used for data visualization but matplotlib is very popular for 2D plotting.

Q.3 What is pyplot? Is it a Python library?
Solution:- The pyplot is one of the interfaces of matplotlib library of Python. This interface offers simple MATLAB style functions that can be used for plotting various types of charts using underlying matplotlib library’s functionality.
Pyplot is an interface, ie., a collection of methods for accessing and using underlying functionality of a library, not a library. The matplotlib library has may other interfaces too, along with pyple interface.
Q.4 Name some commonly used chart types
Solution Some commonly used chart types are line chart, bar chart, pie chart, scatter chart etc.
5. Name the functions you will use to create a (i) line chart, (n) bar chart, (i) scatter chart,
Solution
(i) matplotlib.pyplot.plot()
(ii) matplotlib.pyplot.bar()
(iii) matplotlib.pyplot.scatter()

6. What is scatter chart? How is it different from line chart?
Solution. The scatter chart is a graph of plotted points that show the relationship between two sets of data. With a scatter plot, a mark or marker (usually a dot or small circle), represents a single data point. With one mark (point) for every data point a visual distribution of the data can be seen. Depending on how tightly the points cluster together, you may be able to discern a clear trend in the data.
The difference is that with a scatter plot, the decision is made from the data points such that the individual points should not be connected directly together with a line but instead express a trend.

7. What is histogram? How is it useful?
Solution. A histogram is a statistical tool used to summarise discrete or continuous data. It provides a visual interpretation of numerical data by showing the number of data points that fall within a specified range of values (called “bins”).