Plots

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 14

INTRODUCTION TO

PLOTS
VISHNU N AND TEAM
71772218159.
< PLOTS >

• What is plot?
In R, a "plot" refers to a graphical representation of data. The plot() function in base R is used to create
a variety of graphs, including scatter plots, line plots, and others, to visualize the relationship between variables.
Advanced plotting can be achieved using additional packages like ggplot2, which allows for more detailed and
customizable visualizations
• Why plots?
Plots are crucial in data analysis for visually representing data, making it easier to identify patterns, trends, and
relationships. They help communicate complex findings clearly and effectively to stakeholders. In exploratory
data analysis (EDA), plots guide hypothesis formulation and deeper investigation. Overall, they enhance
decision-making by presenting concise and actionable insights.
<TYPES OF PLOTS>

Line plots (Veeramani U)


Bar Charts (TataTharanitharan)
Histograms (Yukesh Raj)
WV plots (Vignesh G)
Scatter plots with Smoothing lines (Vishnu N)
SCATTER PLOTS AND SMOOTHING LINES

smoothScatter() :
smoothScatter() in R creates a smoothed density scatter plot, useful for visualizing large
datasets by highlighting data density instead of individual points. It uses color gradients to
represent density levels, improving readability and interpretation. This function is ideal for datasets
where traditional Scatter plots become cluttered.

Speacial Feature:
Instead of plotting individual points , which can become cluttered and oerlap in dense
areas, smoothScatter() uses the color gradients to represent varying levels of point density. This
approach enhances readability and interpretation , making it easier to identify regions with higher
concentrations of data.
REPRESENTATION OF SMOOTHSCATTER()

• Color Gradiation
• Unlike the normal scatter plot it
is not with just 1 color.
• We Can clearly observe that
the color is gradually changing.
• The Darker Blue region is the
denser region and the Lighter
Region is the Sparse Region in
the given graphical
representation.

<Graphical repressentation of the smoothScatter() plot function>


SCATTER PLOTS AND SMOOTHING LINES

geom_point() :
geom_plot() in R’s ggplot2 package adds points to a plot it’s commonly used for scatter
plots, where each point represents an observation.You can customize the appearance of points
using parameters like color, size, and shape. Additionally, aesthetics such as x and y mapped to
variables, allowing for visualizing relationships between variables. This function is a fundamental
building black for creating various types of plots in ggplot2.
Special Feature:
It is versatile creating scatter plots where each point represents an observation. It
offers customization options for point appearance and allows mapping of aesthetics like color size
to variables. This flexibility makes it a cornerstone for creating diverse and insightful visualizations
in R.
REPRESENTATION OF GEOM_PLOT()

• Flexibility
• Here we can clearly see that
the colors and the shape of
the Scatterplots can be
changed.
• It Is very useful if we have
more number of data and
can’t able to see the exact and
required data.
• Customized color and the
Shape has been created by the
programer

<Graphical Representation of geom_plot()>


SCATTER PLOTS AND SMOOTHING LINES

geom_smooth() :
geom_smooth() in ggplot2 fits and plots a smooth line to the data, aiding in visualizing
trends. It automatically selects an appropriate smoothing method, such as LEOSS or linear
regression. Additionally, it provides options to customize the line’s appearance and confidence
intervals. This function is useful for exploring relationships between variables and identifying
patterns in the data. It’s commonly used scatter plots to visualize trends and model fits.

Special Feature:
The Special ability to automatically fit and plot a smooth line to the data, revealing
underlying trends. It selects suitable smoothing methods, like LOESS or linear regression, for
accurate confidence intervals , enhancing interpretability. This function simplifies the visualization
od relationships between variables and aids in identifying patterns in data.
REPRESENTATION OF GEOM_SMOOTH()
• Revealing Underlying trends.
• A curve accurately reveals the
Current trend of the graph.
• Here the geom_plot() has been
called without any customization.

ggplot(mpg, aes(displ, hwy))


+ geom_point() +
geom_smooth(orientation =
"y")

<Graphical Representation of geom_smooth()>


SCATTER PLOTS AND SMOOTHING LINES

xyplot() :
xyplot() in R’s lattice package creates scatter plots and line plots It’s particularly useful
for visualizing relationships between two continuous variables and can handle multiple panels for
comparisons. With customizable options for axis labels, tiles and plot appearance, it facilities
clear and concise data presentation.

Special Feature:
The standout feature of this function is lattice package is its capacity for conditioned
plotting, automatically generating multiple panels to compare subsets of data based on
conditioning variable. This capability streamlines the exploration of complex datasets while
maintaining clarity and organization
REPRESENTATION OF XYPLOT():

• Multiple panels
• The main purpose of this
xyplot is to compare the
subsets of the data.
• In this case we have the 3
subset data x,y,z where we
can clearly compare the all
the three subsets.
• Mostly in EDA Exploratory
Data Analysis.

<Graphical Representation of xyplot()>


SCATTER PLOTS AND SMOOTHING LINES

hexplot() :
geom_hex() in R's ggplot2 package creates hexagonal bin plots, a type of 2D histogram. It
aggregates data into hexagonal bins, with color intensity representing the number of
observations in each bin. This plot is particularly useful for visualizing the density of points in a
scatter plot, especially when dealing with large datasets. It offers options for customizing bin
size, color palette, and other visual aspects, facilitating clear and informative data visualization.
Special Feature:
geom_hex() in R's ggplot2 package creates hexagonal bin plots, a type of 2D histogram. It
aggregates data into hexagonal bins, with color intensity representing the number of observations in
each bin. This plot is particularly useful for visualizing the density of points in a scatter plot, especially
when dealing with large datasets. It offers options for customizing bin size, color palette, and other
visual aspects, facilitating clear and informative data visualization.
REPRESENTATION OF GEOM_HEX()

• Color Gradiation and


Discretiazation:
• Here the Data is not Continous
but it is discretiazed.
• The feature of summarization is
inherent to the geom_hex().
• The density of the data is varied
from blue to yellow which is
provided in the right side.

<Graphical representation of the geom_hex() plot function>


NANDRI THALAIVAREY

You might also like