Foundation of Data Science - CS3352 - Important Questions With Answer - Unit 5 - Data Visualization
Foundation of Data Science - CS3352 - Important Questions With Answer - Unit 5 - Data Visualization
Environmental Sciences
Professional English and Sustainability -
Professional English - - II - HS3252 Discrete Mathematics GE3451
I - HS3152 - MA3354
Statistics and Theory of Computation
Matrices and Calculus Numerical Methods - Digital Principles and - CS3452
3rd Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
8th Semester
6th Semester
You can install Matplotlib on a Windows system by following the instructions here:
https://matplotlib.org/faq/installing_faq.html#windows.
4. Can you explain how to create and display a simple plot using matplotlib?
Sure. To create a plot using matplotlib, you will first need to import the matplotlib library.
Once you have imported matplotlib, you can use the plot() function to create a plot. The
plot() function takes two arguments: the data to be plotted, and the type of plot. For example,
to create a line plot, you would use plot(x, y, ‘-‘) where x and y are lists of data points. To
display the plot, you would use the show() function.
Pylab is a module that belongs to the Matplotlib library. It is used for creating two-
dimensional plots and graphs.
Pyplot is a module in matplotlib that provides a set of functions for creating and manipulating
plots. Pylab is a module that combines pyplot with numpy, providing a set of tools for
numerical calculations and plotting.
PyLab is designed to be a simple, concise interface to the powerful Matplotlib library. The
stateful interface is designed to make it easy to use Matplotlib without having to create a lot
of extra code or objects.
CS3352_FDS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes Page 1 of 4
www.BrainKart.com
4931_Grace College of Engineering, Thoothukudi
The best way to draw multiple lines in a single figure is to use the plot() function. This
function can take multiple arguments, each of which will be plotted as a separate line. For
example, to plot two lines, you would use the following code:
9. What is the simplest way to add text annotations and labels to plots in
Python?
The simplest way to add text annotations and labels to plots in Python is to use the
matplotlib.pyplot.text() function. This function allows you to add text at any location on the
plot, and also allows you to specify the font size, style, and color of the text.
The “hold” command is used to tell Matplotlib to keep all of the current plot elements on the
screen when adding new ones. This can be useful when you want to add multiple elements to
a plot and have them all appear at the same time. Without the “hold” command, each new
plot element would overwrite the previous one.
11. Is it possible to modify the tick label size for all plots in Matplotlib? If yes,
then how?
Yes, it is possible to modify the tick label size for all plots in Matplotlib. This can be done by
using the rcParams command.
12. Can you provide me examples of when a scatter graph would be more
appropriate than a line chart or vice versa?
A scatter graph would be more appropriate than a line chart when you are looking to show
the relationship between two variables that are not linearly related. For example, if you were
looking to show the relationship between a person’s age and their weight, a scatter graph
would be more appropriate than a line chart. A line chart would be more appropriate than a
scatter graph when you are looking to show a trend over time. For example, if you were
looking at the monthly sales of a company over the course of a year, a line chart would be
more appropriate than a scatter graph.
One way to generate histograms in Matplotlib is to use the pyplot.hist() function. This
function takes in an array of data and generates a histogram from it.
Subplots are used to plot multiple figures on one figure. This can be used to compare data
side by side or to show multiple views of the same data.
CS3352_FDS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes Page 2 of 4
www.BrainKart.com
4931_Grace College of Engineering, Thoothukudi
There are a few reasons why we might want to customize our axes. One reason is to make the
plot more readable or understandable. For example, if we are plotting data that spans a large
range, we might want to use a logarithmic scale to compress the data and make it easier to
interpret. Another reason to customize our axes is for aesthetic reasons. We might want to
change the color, line width, or tick marks to make our plot more visually appealing.
The twinx() function in Matplotlib is used to create a second axes that shares the same x-axis
as the original axes. This is often used when you want to plot two different data sets on the
same plot, but with different y-axes.
17. What is your opinion about Matplotlib being a part of SciPy stack?
I believe that Matplotlib is a valuable part of the SciPy stack because it provides a powerful
and flexible platform for creating visualizations of data. It is also easy to use, which makes it
accessible to a wide range of users.
20. What are the various ways to handle exceptions while plotting graphs in
Matplotlib?
There are a few different ways to handle exceptions while plotting graphs in Matplotlib. One
way is to use a try/except block around your code. Another way is to use the Matplotlib built-
in function plt.errorbar(). This function will automatically plot error bars on your graph.
PART-B
1. Write python program to visualize the dataset using scatterplot and explain its
parameters.
2. Eloborate the error visualization metods in pyplot.
3. Explain different methods of showing 3D surface ib a 2D plane with example.
4. Demonstrate the usage of histograms for data exploration and explain its attributes.
5. Elaborate the concept of subplots and its applications.
6. Discuss in detail about the 3D plotting functions of matplotlib module.
7. Explain in detail about the functions of mpl_tool kit for Geographic data
visualization.
CS3352_FDS
https://play.google.com/store/apps/details?id=info.therithal.brainkart.annauniversitynotes Page 3 of 4
Click on Subject/Paper under Semester to enter.
Professional English Discrete Mathematics Environmental Sciences
Professional English - - II - HS3252 - MA3354 and Sustainability -
I - HS3152 GE3451
Digital Principles and
Statistics and Probability and
Computer Organization
Matrices and Calculus Numerical Methods - Statistics - MA3391
- CS3351
- MA3151 MA3251
3rd Semester
1st Semester
4th Semester
2nd Semester
Deep Learning -
AD3501
Embedded Systems
Data and Information Human Values and
and IoT - CS3691
5th Semester
7th Semester
8th Semester
Open Elective-1
Distributed Computing Open Elective 2
- CS3551 Project Work /
Elective-3
Open Elective 3 Intership
Big Data Analytics - Elective-4
CCS334 Open Elective 4
Elective-5
Elective 1 Management Elective
Elective-6
Elective 2
All Computer Engg Subjects - [ B.E., M.E., ] (Click on Subjects to enter)
Programming in C Computer Networks Operating Systems
Programming and Data Programming and Data Problem Solving and Python
Structures I Structure II Programming
Database Management Systems Computer Architecture Analog and Digital
Communication
Design and Analysis of Microprocessors and Object Oriented Analysis
Algorithms Microcontrollers and Design
Software Engineering Discrete Mathematics Internet Programming
Theory of Computation Computer Graphics Distributed Systems
Mobile Computing Compiler Design Digital Signal Processing
Artificial Intelligence Software Testing Grid and Cloud Computing
Data Ware Housing and Data Cryptography and Resource Management
Mining Network Security Techniques
Service Oriented Architecture Embedded and Real Time Multi - Core Architectures
Systems and Programming
Probability and Queueing Theory Physics for Information Transforms and Partial
Science Differential Equations
Technical English Engineering Physics Engineering Chemistry
Engineering Graphics Total Quality Professional Ethics in
Management Engineering
Basic Electrical and Electronics Problem Solving and Environmental Science and
and Measurement Engineering Python Programming Engineering
Click on Subject/Paper under Semester to enter.
Environmental Sciences
Professional English and Sustainability -
Professional English - - II - HS3252 Discrete Mathematics GE3451
I - HS3152 - MA3354
Statistics and Theory of Computation
Matrices and Calculus Numerical Methods - Digital Principles and - CS3452
3rd Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
8th Semester
6th Semester
4th Semester
- MA3151 MA3251 Computer Organization
1st Semester
2nd Semester
Computer Networks -
CS3591
Object Oriented
Full Stack Web Software Engineering - Human Values and
5th Semester
8th Semester
6th Semester
Elective 1 Elective-5
Management Elective
Elective-6
Elective 2
All Computer Engg Subjects - [ B.E., M.E., ] (Click on Subjects to enter)
Programming in C Computer Networks Operating Systems
Programming and Data Programming and Data Problem Solving and Python
Structures I Structure II Programming
Database Management Systems Computer Architecture Analog and Digital
Communication
Design and Analysis of Microprocessors and Object Oriented Analysis
Algorithms Microcontrollers and Design
Software Engineering Discrete Mathematics Internet Programming
Theory of Computation Computer Graphics Distributed Systems
Mobile Computing Compiler Design Digital Signal Processing
Artificial Intelligence Software Testing Grid and Cloud Computing
Data Ware Housing and Data Cryptography and Resource Management
Mining Network Security Techniques
Service Oriented Architecture Embedded and Real Time Multi - Core Architectures
Systems and Programming
Probability and Queueing Theory Physics for Information Transforms and Partial
Science Differential Equations
Technical English Engineering Physics Engineering Chemistry
Engineering Graphics Total Quality Professional Ethics in
Management Engineering
Basic Electrical and Electronics Problem Solving and Environmental Science and
and Measurement Engineering Python Programming Engineering