SlideShare a Scribd company logo
1 of 13
www.r-squared.in/git-hub
dataCrunch
Data Visualization With R
Learn To Add/Modify Color To Plots
dataCrunchCourse Material
Slide 2
All the material related to this course are available at our Website
Slides can be viewed at SlideShare
Scripts can be downloaded from GitHub
Videos can be viewed on our Youtube Channel
dataCrunch
Color
Slide 3
dataCrunchColor
Slide 4
In this section, we will learn to add colors to the following using the col argument:
● Plot Symbol
● Title & Subtitle
● Axis
● Axis Labels
● Foreground
dataCrunchSyntax
Slide 5
Feature Argument Value Example
Symbol col
String
Hexadecimal
RGB
"blue"
Title col.main "#0000ff"
Subtitle col.sub rgb(0, 0, 1)
Axis col.axis "red"
Label col.lab "#ff0000"
Foreground fg rgb(1, 0, 0)
The col argument can be used along with main, sub, axis and lab arguments to specify the color of
the title, subtitle, axes and the labels.
dataCrunchColor: Symbol
Slide 6
# modify color of the plot
plot(mtcars$disp, mtcars$mpg,
col= "red")
OR
plot(mtcars$disp, mtcars$mpg,
col = "#ff0000")
OR
plot(mtcars$disp, mtcars$mpg,
col = rgb(1, 0, 0))
Description
Let us begin by adding color to the symbol in the
plot using the col argument in the plot()
function.
Code
dataCrunchColor: Title
Slide 7
# modify the color of the title
plot(mtcars$disp, mtcars$mpg,
main = "Displacement vs Miles Per Gallon",
col.main = "blue")
OR
plot(mtcars$disp, mtcars$mpg,
main = "Displacement vs Miles Per Gallon",
col.main = "#0000ff")
OR
plot(mtcars$disp, mtcars$mpg,
main = "Displacement vs Miles Per Gallon",
col.main = rgb(0, 0, 1))
Description
The color of the title can be modified by using the
col.main argument in the plot() function.
Code
dataCrunchColor: Subtitle
Slide 8
# modify the color of the subtitle
plot(mtcars$disp, mtcars$mpg,
sub= "Displacement vs Miles Per Gallon",
col.sub = "blue")
OR
plot(mtcars$disp, mtcars$mpg,
sub= "Displacement vs Miles Per Gallon",
col.sub = "#0000ff")
OR
plot(mtcars$disp, mtcars$mpg,
sub= "Displacement vs Miles Per Gallon",
col.sub = rgb(0, 0, 1))
Description
The color of the subtitle can be modified by using
the col.sub argument in the plot() function.
Code
dataCrunchColor: Axis
Slide 9
# modify the color of the axis
plot(mtcars$disp, mtcars$mpg,
col.axis = "blue")
OR
plot(mtcars$disp, mtcars$mpg,
col.axis = "#0000ff")
OR
plot(mtcars$disp, mtcars$mpg,
col.axis = rgb(0, 0, 1))
Description
The color of the axis can be modified by using the
col.axis argument in the plot() function.
Code
dataCrunchColor: Labels
Slide 10
# modify the color of the labels
plot(mtcars$disp, mtcars$mpg,
xlab = "Displacement",
ylab = "Miles Per Gallon",
col.lab = "blue")
Description
The color of the labels can be modified by using the
col.lab argument in the plot() function.
Code
dataCrunchColor: Foreground
Slide 11
# modify the color of the foreground
plot(mtcars$disp, mtcars$mpg,
fg= "red")
Description
The color of the foreground can be modified by
using the fg argument in the plot() function.
Code
dataCrunchColor: Using title() function
Slide 12
# Create a basic plot
plot(mtcars$disp, mtcars$mpg, ann= FALSE)
# modify color using title() function
title(main = "Displacement vs Miles Per Gallon",
xlab = "Displacement",
ylab = "Miles Per Gallon",
col.main = "blue", col.lab = "red")
Description
The colors of the title, subtitle and the labels can be
modified using the title() function as well. Let us
try it out:
Code
dataCrunch
Slide 13
Visit dataCrunch for
tutorials on:
→ R Programming
→ Business Analytics
→ Data Visualization
→ Web Applications
→ Package Development
→ Git & GitHub

More Related Content

What's hot (19)

Conversion from infix to prefix using stack
Conversion from infix to prefix using stackConversion from infix to prefix using stack
Conversion from infix to prefix using stack
 
A Survey Of R Graphics
A Survey Of R GraphicsA Survey Of R Graphics
A Survey Of R Graphics
 
Data structures
Data structures Data structures
Data structures
 
Chapter13 two-dimensional-array
Chapter13 two-dimensional-arrayChapter13 two-dimensional-array
Chapter13 two-dimensional-array
 
Ds list of experiments ce
Ds list of experiments ceDs list of experiments ce
Ds list of experiments ce
 
Queue
QueueQueue
Queue
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
Lecture 1 mte 407
Lecture 1 mte 407Lecture 1 mte 407
Lecture 1 mte 407
 
The matplotlib Library
The matplotlib LibraryThe matplotlib Library
The matplotlib Library
 
CS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna UniversityCS8391 Data Structures Part B Questions Anna University
CS8391 Data Structures Part B Questions Anna University
 
Lecture 07
Lecture 07Lecture 07
Lecture 07
 
H Alg2 091409
H Alg2 091409H Alg2 091409
H Alg2 091409
 
Tools for research plotting
Tools for research plottingTools for research plotting
Tools for research plotting
 
Functional programming in Swift
Functional programming in SwiftFunctional programming in Swift
Functional programming in Swift
 
2.1.2 functions and their graphs
2.1.2 functions and their graphs2.1.2 functions and their graphs
2.1.2 functions and their graphs
 
TikZ for economists
TikZ for economistsTikZ for economists
TikZ for economists
 
Assignment3
Assignment3Assignment3
Assignment3
 
Function recap
Function recapFunction recap
Function recap
 
SMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTSSMU BCA SEM 1 FALL 2016 ASSIGNMENTS
SMU BCA SEM 1 FALL 2016 ASSIGNMENTS
 

Viewers also liked

Codes and conventions of a contents page
Codes and conventions of a contents pageCodes and conventions of a contents page
Codes and conventions of a contents pagebaileyharland
 
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)Ajeet Kumar198282
 
Resume_Networking_profile__Harish_New_CV
Resume_Networking_profile__Harish_New_CVResume_Networking_profile__Harish_New_CV
Resume_Networking_profile__Harish_New_CVHarish Raghav
 
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...Mr.Allah Dad Khan
 
Ordnance School Diploma
Ordnance School DiplomaOrdnance School Diploma
Ordnance School DiplomaAntoine Ngemhe
 
powerpoint nota dinas
powerpoint nota dinaspowerpoint nota dinas
powerpoint nota dinasImas Fera
 
Step by step of my music magazine contents
Step by step of my music magazine contentsStep by step of my music magazine contents
Step by step of my music magazine contentskatiehatton123
 
Codes and conventions of kerrang’s
Codes and conventions of kerrang’sCodes and conventions of kerrang’s
Codes and conventions of kerrang’skatiehatton123
 

Viewers also liked (14)

Codes and conventions of a contents page
Codes and conventions of a contents pageCodes and conventions of a contents page
Codes and conventions of a contents page
 
Resume 786
Resume 786Resume 786
Resume 786
 
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)
ajeet kumar Delhi 12+ yrs (3+ AS AN HR RECRUITER)
 
Resume_Networking_profile__Harish_New_CV
Resume_Networking_profile__Harish_New_CVResume_Networking_profile__Harish_New_CV
Resume_Networking_profile__Harish_New_CV
 
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...
Broad bean diseases A Lecture By Allah Dad Khan Provincial Coordinator IPM MI...
 
Ordnance School Diploma
Ordnance School DiplomaOrdnance School Diploma
Ordnance School Diploma
 
Pepipost
PepipostPepipost
Pepipost
 
Mejoras del colegio
Mejoras del colegioMejoras del colegio
Mejoras del colegio
 
april
aprilapril
april
 
powerpoint nota dinas
powerpoint nota dinaspowerpoint nota dinas
powerpoint nota dinas
 
Question 5
Question 5Question 5
Question 5
 
Step by step of my music magazine contents
Step by step of my music magazine contentsStep by step of my music magazine contents
Step by step of my music magazine contents
 
Codes and conventions of kerrang’s
Codes and conventions of kerrang’sCodes and conventions of kerrang’s
Codes and conventions of kerrang’s
 
PPT Kewirausahaan Kepererawatan Baby spa health center
PPT Kewirausahaan Kepererawatan Baby spa health centerPPT Kewirausahaan Kepererawatan Baby spa health center
PPT Kewirausahaan Kepererawatan Baby spa health center
 

Similar to Data Visualization With R: Learn To Modify Color Of Plots

CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel UpdatingMark Kilgard
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkTUOS-Sam
 
Q plot tutorial
Q plot tutorialQ plot tutorial
Q plot tutorialAbhik Seal
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using rTahera Shaikh
 
The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184Mahmoud Samir Fayed
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184Mahmoud Samir Fayed
 
R and Visualization: A match made in Heaven
R and Visualization: A match made in HeavenR and Visualization: A match made in Heaven
R and Visualization: A match made in HeavenEdureka!
 
Data visualization using the grammar of graphics
Data visualization using the grammar of graphicsData visualization using the grammar of graphics
Data visualization using the grammar of graphicsRupak Roy
 
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptxRamanathanSabesan
 
The 2nd graph database in sv meetup
The 2nd graph database in sv meetupThe 2nd graph database in sv meetup
The 2nd graph database in sv meetupJoshua Bae
 
R, Scikit-Learn and Apache Spark ML - What difference does it make?
R, Scikit-Learn and Apache Spark ML - What difference does it make?R, Scikit-Learn and Apache Spark ML - What difference does it make?
R, Scikit-Learn and Apache Spark ML - What difference does it make?Villu Ruusmann
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language CHANDAN KUMAR
 

Similar to Data Visualization With R: Learn To Modify Color Of Plots (20)

Data Visualization With R
Data Visualization With RData Visualization With R
Data Visualization With R
 
CS 354 Pixel Updating
CS 354 Pixel UpdatingCS 354 Pixel Updating
CS 354 Pixel Updating
 
Computation Assignment Help
Computation Assignment Help Computation Assignment Help
Computation Assignment Help
 
CIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & CourseworkCIV1900 Matlab - Plotting & Coursework
CIV1900 Matlab - Plotting & Coursework
 
Q plot tutorial
Q plot tutorialQ plot tutorial
Q plot tutorial
 
Exploratory data analysis using r
Exploratory data analysis using rExploratory data analysis using r
Exploratory data analysis using r
 
The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88The Ring programming language version 1.3 book - Part 38 of 88
The Ring programming language version 1.3 book - Part 38 of 88
 
The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184The Ring programming language version 1.5.3 book - Part 58 of 184
The Ring programming language version 1.5.3 book - Part 58 of 184
 
The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184The Ring programming language version 1.5.3 book - Part 48 of 184
The Ring programming language version 1.5.3 book - Part 48 of 184
 
R and Visualization: A match made in Heaven
R and Visualization: A match made in HeavenR and Visualization: A match made in Heaven
R and Visualization: A match made in Heaven
 
Data visualization using the grammar of graphics
Data visualization using the grammar of graphicsData visualization using the grammar of graphics
Data visualization using the grammar of graphics
 
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
2GKS, Open GL and IGES_Video Lect Given by Renjin.pptx
 
2nd Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
2nd  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...2nd  Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
2nd Semester M Tech: Computer Science and Engineering (Jun-2016) Question Pa...
 
The 2nd graph database in sv meetup
The 2nd graph database in sv meetupThe 2nd graph database in sv meetup
The 2nd graph database in sv meetup
 
Basic Analysis using Python
Basic Analysis using PythonBasic Analysis using Python
Basic Analysis using Python
 
R, Scikit-Learn and Apache Spark ML - What difference does it make?
R, Scikit-Learn and Apache Spark ML - What difference does it make?R, Scikit-Learn and Apache Spark ML - What difference does it make?
R, Scikit-Learn and Apache Spark ML - What difference does it make?
 
Chart and graphs in R programming language
Chart and graphs in R programming language Chart and graphs in R programming language
Chart and graphs in R programming language
 
MLflow with R
MLflow with RMLflow with R
MLflow with R
 
7th Semester Computer Science (2013-June) Question Papers
7th Semester Computer Science (2013-June) Question Papers7th Semester Computer Science (2013-June) Question Papers
7th Semester Computer Science (2013-June) Question Papers
 
7th cs june 2013
7th cs   june 20137th cs   june 2013
7th cs june 2013
 

More from Rsquared Academy

Market Basket Analysis in R
Market Basket Analysis in RMarket Basket Analysis in R
Market Basket Analysis in RRsquared Academy
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using RRsquared Academy
 
Writing Readable Code with Pipes
Writing Readable Code with PipesWriting Readable Code with Pipes
Writing Readable Code with PipesRsquared Academy
 
Read data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRead data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRsquared Academy
 
Read/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRead/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRsquared Academy
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in RRsquared Academy
 
How to install & update R packages?
How to install & update R packages?How to install & update R packages?
How to install & update R packages?Rsquared Academy
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRsquared Academy
 
R Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersR Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersRsquared Academy
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to MatricesRsquared Academy
 
R Programming: Introduction to Vectors
R Programming: Introduction to VectorsR Programming: Introduction to Vectors
R Programming: Introduction to VectorsRsquared Academy
 
R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data TypesRsquared Academy
 
R Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RR Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RRsquared Academy
 

More from Rsquared Academy (20)

Handling Date & Time in R
Handling Date & Time in RHandling Date & Time in R
Handling Date & Time in R
 
Market Basket Analysis in R
Market Basket Analysis in RMarket Basket Analysis in R
Market Basket Analysis in R
 
Practical Introduction to Web scraping using R
Practical Introduction to Web scraping using RPractical Introduction to Web scraping using R
Practical Introduction to Web scraping using R
 
Joining Data with dplyr
Joining Data with dplyrJoining Data with dplyr
Joining Data with dplyr
 
Explore Data using dplyr
Explore Data using dplyrExplore Data using dplyr
Explore Data using dplyr
 
Data Wrangling with dplyr
Data Wrangling with dplyrData Wrangling with dplyr
Data Wrangling with dplyr
 
Writing Readable Code with Pipes
Writing Readable Code with PipesWriting Readable Code with Pipes
Writing Readable Code with Pipes
 
Introduction to tibbles
Introduction to tibblesIntroduction to tibbles
Introduction to tibbles
 
Read data from Excel spreadsheets into R
Read data from Excel spreadsheets into RRead data from Excel spreadsheets into R
Read data from Excel spreadsheets into R
 
Read/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into RRead/Import data from flat/delimited files into R
Read/Import data from flat/delimited files into R
 
Variables & Data Types in R
Variables & Data Types in RVariables & Data Types in R
Variables & Data Types in R
 
How to install & update R packages?
How to install & update R packages?How to install & update R packages?
How to install & update R packages?
 
How to get help in R?
How to get help in R?How to get help in R?
How to get help in R?
 
Introduction to R
Introduction to RIntroduction to R
Introduction to R
 
RMySQL Tutorial For Beginners
RMySQL Tutorial For BeginnersRMySQL Tutorial For Beginners
RMySQL Tutorial For Beginners
 
R Markdown Tutorial For Beginners
R Markdown Tutorial For BeginnersR Markdown Tutorial For Beginners
R Markdown Tutorial For Beginners
 
R Programming: Introduction to Matrices
R Programming: Introduction to MatricesR Programming: Introduction to Matrices
R Programming: Introduction to Matrices
 
R Programming: Introduction to Vectors
R Programming: Introduction to VectorsR Programming: Introduction to Vectors
R Programming: Introduction to Vectors
 
R Programming: Variables & Data Types
R Programming: Variables & Data TypesR Programming: Variables & Data Types
R Programming: Variables & Data Types
 
R Programming: Mathematical Functions In R
R Programming: Mathematical Functions In RR Programming: Mathematical Functions In R
R Programming: Mathematical Functions In R
 

Recently uploaded

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Valters Lauzums
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制vexqp
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...gajnagarg
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabiaahmedjiabur940
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Klinik kandungan
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangeThinkInnovation
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Researchmichael115558
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...nirzagarg
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.pptibrahimabdi22
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制vexqp
 
Data Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdfData Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdftheeltifs
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schscnajjemba
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制vexqp
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........EfruzAsilolu
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样wsppdmt
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATIONLakpaYanziSherpa
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...Elaine Werffeli
 

Recently uploaded (20)

Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
Digital Advertising Lecture for Advanced Digital & Social Media Strategy at U...
 
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
怎样办理圣地亚哥州立大学毕业证(SDSU毕业证书)成绩单学校原版复制
 
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In bhavnagar [ 7014168258 ] Call Me For Genuine Models...
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
Discover Why Less is More in B2B Research
Discover Why Less is More in B2B ResearchDiscover Why Less is More in B2B Research
Discover Why Less is More in B2B Research
 
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Begusarai [ 7014168258 ] Call Me For Genuine Models...
 
7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt7. Epi of Chronic respiratory diseases.ppt
7. Epi of Chronic respiratory diseases.ppt
 
Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...Sequential and reinforcement learning for demand side management by Margaux B...
Sequential and reinforcement learning for demand side management by Margaux B...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
怎样办理旧金山城市学院毕业证(CCSF毕业证书)成绩单学校原版复制
 
Data Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdfData Analyst Tasks to do the internship.pdf
Data Analyst Tasks to do the internship.pdf
 
PLE-statistics document for primary schs
PLE-statistics document for primary schsPLE-statistics document for primary schs
PLE-statistics document for primary schs
 
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
怎样办理伦敦大学毕业证(UoL毕业证书)成绩单学校原版复制
 
Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........Switzerland Constitution 2002.pdf.........
Switzerland Constitution 2002.pdf.........
 
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
一比一原版(UCD毕业证书)加州大学戴维斯分校毕业证成绩单原件一模一样
 
Abortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get CytotecAbortion pills in Jeddah | +966572737505 | Get Cytotec
Abortion pills in Jeddah | +966572737505 | Get Cytotec
 
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATIONCapstone in Interprofessional Informatic  // IMPACT OF COVID 19 ON EDUCATION
Capstone in Interprofessional Informatic // IMPACT OF COVID 19 ON EDUCATION
 
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
SAC 25 Final National, Regional & Local Angel Group Investing Insights 2024 0...
 

Data Visualization With R: Learn To Modify Color Of Plots

  • 1. www.r-squared.in/git-hub dataCrunch Data Visualization With R Learn To Add/Modify Color To Plots
  • 2. dataCrunchCourse Material Slide 2 All the material related to this course are available at our Website Slides can be viewed at SlideShare Scripts can be downloaded from GitHub Videos can be viewed on our Youtube Channel
  • 4. dataCrunchColor Slide 4 In this section, we will learn to add colors to the following using the col argument: ● Plot Symbol ● Title & Subtitle ● Axis ● Axis Labels ● Foreground
  • 5. dataCrunchSyntax Slide 5 Feature Argument Value Example Symbol col String Hexadecimal RGB "blue" Title col.main "#0000ff" Subtitle col.sub rgb(0, 0, 1) Axis col.axis "red" Label col.lab "#ff0000" Foreground fg rgb(1, 0, 0) The col argument can be used along with main, sub, axis and lab arguments to specify the color of the title, subtitle, axes and the labels.
  • 6. dataCrunchColor: Symbol Slide 6 # modify color of the plot plot(mtcars$disp, mtcars$mpg, col= "red") OR plot(mtcars$disp, mtcars$mpg, col = "#ff0000") OR plot(mtcars$disp, mtcars$mpg, col = rgb(1, 0, 0)) Description Let us begin by adding color to the symbol in the plot using the col argument in the plot() function. Code
  • 7. dataCrunchColor: Title Slide 7 # modify the color of the title plot(mtcars$disp, mtcars$mpg, main = "Displacement vs Miles Per Gallon", col.main = "blue") OR plot(mtcars$disp, mtcars$mpg, main = "Displacement vs Miles Per Gallon", col.main = "#0000ff") OR plot(mtcars$disp, mtcars$mpg, main = "Displacement vs Miles Per Gallon", col.main = rgb(0, 0, 1)) Description The color of the title can be modified by using the col.main argument in the plot() function. Code
  • 8. dataCrunchColor: Subtitle Slide 8 # modify the color of the subtitle plot(mtcars$disp, mtcars$mpg, sub= "Displacement vs Miles Per Gallon", col.sub = "blue") OR plot(mtcars$disp, mtcars$mpg, sub= "Displacement vs Miles Per Gallon", col.sub = "#0000ff") OR plot(mtcars$disp, mtcars$mpg, sub= "Displacement vs Miles Per Gallon", col.sub = rgb(0, 0, 1)) Description The color of the subtitle can be modified by using the col.sub argument in the plot() function. Code
  • 9. dataCrunchColor: Axis Slide 9 # modify the color of the axis plot(mtcars$disp, mtcars$mpg, col.axis = "blue") OR plot(mtcars$disp, mtcars$mpg, col.axis = "#0000ff") OR plot(mtcars$disp, mtcars$mpg, col.axis = rgb(0, 0, 1)) Description The color of the axis can be modified by using the col.axis argument in the plot() function. Code
  • 10. dataCrunchColor: Labels Slide 10 # modify the color of the labels plot(mtcars$disp, mtcars$mpg, xlab = "Displacement", ylab = "Miles Per Gallon", col.lab = "blue") Description The color of the labels can be modified by using the col.lab argument in the plot() function. Code
  • 11. dataCrunchColor: Foreground Slide 11 # modify the color of the foreground plot(mtcars$disp, mtcars$mpg, fg= "red") Description The color of the foreground can be modified by using the fg argument in the plot() function. Code
  • 12. dataCrunchColor: Using title() function Slide 12 # Create a basic plot plot(mtcars$disp, mtcars$mpg, ann= FALSE) # modify color using title() function title(main = "Displacement vs Miles Per Gallon", xlab = "Displacement", ylab = "Miles Per Gallon", col.main = "blue", col.lab = "red") Description The colors of the title, subtitle and the labels can be modified using the title() function as well. Let us try it out: Code
  • 13. dataCrunch Slide 13 Visit dataCrunch for tutorials on: → R Programming → Business Analytics → Data Visualization → Web Applications → Package Development → Git & GitHub