본문 바로가기
공부/R Programming

R기초; R 기초 - ggplot2 그래픽5 - 테마

by 혼밥맨 2021. 1. 24.
반응형

 R기초; R 기초 - ggplot2 그래픽5 - 테마

 

library(ggplot2)

 

library(car)

str(Salaries)

 

ggplot(Salaries, aes(x=yrs.since.phd, y=salary, color=rank, shape=rank)) + 

         geom_point() +

         facet_grid(. ~ sex) +

         theme_gray()

 

?theme_gray

 

theme()

 

ggplot(Salaries, aes(x=rank, y=salary, fill=sex)) + 

        geom_boxplot() +

        labs(title="Salary by Rank and Sex",

              x="Rank", y="Salary") +

        theme(plot.title=element_text(face="bold.italic", size=14, color="brown"))

 

 

library(lattice)

ggplot(singer, aes(x=voice.part, y=height)) +

         geom_boxplot() + 

         labs(title="Height by voice part", 

               x = "Voice Part", y= "Height") +

         mytheme

 

 

반응형

댓글