ggplot()
R에서 사용하여 데이터를 성공적으로 플로팅 했습니다. 그러나 log10 스케일링에서 y 축과 x 축을 선택하면 y 축의 첫 번째 눈금 (0.01)이 교차점에서 첫 번째 눈금보다 더 멀리 떨어져 있습니다. x 축 (0.01). x 축이 y 축과 동일한 "배율"을 갖도록해야합니다.
다음은 내 코드입니다. 또한 데이터 (sep = "\ t"사용). 그리고 그래프가 나를 어떻게 찾는 지에 대한 이미지. 데이터가 외부 링크에있어 죄송합니다. 그렇지 않으면 재현 가능한 데이터로 제공하는 방법을 알 수 없습니다!
FILE1 <- read.delim("example.txt", sep="\t", header = TRUE)
EXAMPLE_PLOT <- ggplot(FILE1, aes_string(x = colnames(FILE1)[1], y = colnames(FILE1)[2])) +
geom_point(size=4) +
ggtitle("EXAMPLE_PLOT") +
theme(plot.title = element_text(family="Calibri", color="black",
face="bold", size = 32, hjust=0)) +
theme(plot.background= element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank())+
theme(panel.background = element_blank())+
theme(axis.line.x = element_line(color="black", size = 1),
axis.line.y = element_line(color="black", size = 1))+
theme(axis.ticks = element_line(color="black", size = 1))+
theme(axis.ticks.length = unit(0.3,"cm"))+
theme(axis.title = element_text(family = "Calibri",
color="black", size=17, face="bold"))+
theme(axis.text.x = element_text(family = "Calibri", color="black",
size=14, face="bold"),
axis.text.y = element_text(family = "Calibri", color="black",
size=14, face="bold"))+
scale_x_log10(breaks=c(.01, .1, 1, 10, 100))+
scale_y_log10(breaks=c(.01, .1, 1, 10, 100))+
geom_smooth(method=lm)
EXAMPLE_PLOT
및 에 추가 limits
하는 것을 잊었습니다 .scale_x_log10
scale_y_log10
FILE1 <- read.delim("example.txt", sep="\t", header = TRUE)
EXAMPLE_PLOT <- ggplot(FILE1, aes_string(x = colnames(FILE1)[1], y = colnames(FILE1)[2])) +
geom_point(size=4) +
ggtitle("EXAMPLE_PLOT") +
theme(plot.title = element_text(family="Calibri", color="black",
face="bold", size = 32, hjust=0)) +
theme(plot.background= element_blank(),
panel.grid.major = element_blank(),
panel.grid.minor = element_blank())+
theme(panel.background = element_blank())+
theme(axis.line.x = element_line(color="black", size = 1),
axis.line.y = element_line(color="black", size = 1))+
theme(axis.ticks = element_line(color="black", size = 1))+
theme(axis.ticks.length = unit(0.3,"cm"))+
theme(axis.title = element_text(family = "Calibri",
color="black", size=17, face="bold"))+
theme(axis.text.x = element_text(family = "Calibri", color="black",
size=14, face="bold"),
axis.text.y = element_text(family = "Calibri", color="black",
size=14, face="bold"))+
scale_x_log10(breaks=c(.01, .1, 1, 10, 100), limits = c(0.01,10))+
scale_y_log10(breaks=c(.01, .1, 1, 10, 100), limits = c(0.01,10))+
geom_smooth(method=lm)
EXAMPLE_PLOT
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다