Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

EXPERIMENT NO 1.

Student Name: Shivam Sharma UID: 20MSM3049

Branch: M.Sc. Data Science Section/Group: A

Semester: 2nd
Date of Performance: 21/02/2021
Subject Name: Data Visualization Subject Code: 20SDT-654

AIM OF THE EXPERIMENT – To understand Basic Plot functions for Data Visualization.

OVERVIEW

The graphics package is used for plotting base graphs like scatter plot, box plot etc. A
complete list of functions with help pages can be obtained by typing : library(help =
"graphics").

The plot() function


 The plot() function is a kind of a generic function for plotting of R objects.

1) plot(airquality$Ozone)
Output:

We get a scatter/dot plot here wherein each dot represents the value of the Ozone in mean
parts per billion.

SUBJECT NAME-Data Visualization SUBJECT CODE-


Lab 20SDP656
2) Let us now plot a graph between the Ozone and Wind values to study the relationship
between the two.

Example - plot(airquality$Ozone, airquality$Wind)

Output:

The plot shows that Wind and Ozone values have a somewhat negative correlation.

3) plot(airquality)

SUBJECT NAME-Data Visualization SUBJECT CODE-


Lab 20SDP656
We get a matrix of scatterplots which is a correlation matrix of all the columns. The plot
above instantly shows that:

 The level of Ozone and Temperature is correlated positively.


 Wind speed is negatively correlated to both Temperature and Ozone level.

We can quickly discover the relationship between variables by merely looking at the plots drawn
between them.

Using arguments with the plot() function

We can easily style our charts by playing with the arguments of the plot() function.

type argument

The plot function has an argument called typewhich can take in values like p: points, l:
lines,b: both etc. This decides the shape of the output graph.

4) plot(airquality$Ozone, type= "b")

Above graph comes up with points and line.

5) plot(airquality$Ozone, type= "h")

This graph displays high density vertical lines.

SUBJECT NAME-Data Visualization SUBJECT CODE-


Lab 20SDP656
LEARNING OUTCOMES:
1. We have learnt how to use plot function on a dataset like airquality.

2. We have learnt different graphs using plot function.

EVALUATION COLUMN :

Sr. No. Parameters Maximum Marks


Marks Obtained
1. Student’s performance while executing the
program in Computer Lab
2. Completion of worksheet with learning
outcomes and program’s output along
with
cleanliness and discipline.
3. Clarification of theoretical concepts
4. Total Marks

5. Teacher’s Signature (with date)

SUBJECT NAME-Data Visualization SUBJECT CODE-


Lab 20SDP656

You might also like