IT박스

ggplot2에서 기본 글꼴 크기를 변경하는 방법

itboxs 2020. 8. 22. 08:24
반응형

ggplot2에서 기본 글꼴 크기를 변경하는 방법


ggplot2전체 R 세션에 대해 글꼴 크기와 같은 그래픽의 일부 기본 매개 변수를 변경할 수 있는지 알고 싶습니다 . 아이디어는 각 플롯에 대해 설정하지 않는 것입니다.


사용하다 theme_set()

theme_set(theme_gray(base_size = 18))
qplot(1:10, 1:10)

여기에 이미지 설명 입력


theme_set나머지 활성 세션을 업데이트 하려면 다음을 사용하십시오 .

theme_set(theme_grey(base_size = 18)) 

하나의 그래프 만 변경 base_size하려면 테마에서 다음을 설정할 수 있습니다 .

qplot(1:10, 1:10) + theme_grey(base_size = 18) 
ggplot(mtcars, aes(x = mpg, y = cyl)) + 
geom_point() +
theme_grey(base_size = 18) 

참고 URL : https://stackoverflow.com/questions/11955229/how-to-change-the-default-font-size-in-ggplot2

반응형