R语言对比图

时间:2022-09-06 01:44:35

CCA <-c(4959,2324)
names(CCA)<-C("A")
CCB <-c(7010,2333)
names(CCA)<-C("B")   
CC <- cbind(CCA, CCB)  
barplot(t(CC), beside = TRUE,legend = c("tomcat", "netty"),
width = c(10, 10), args.legend = list(x = "topleft", cex=1),
xlim = c(0, 50),ylim = c(0, 10000),cex = 2,cex.axis=2)
title(ylab="TPS")

 

 

 

CCB <-c(1, 4, 11, 24)
CCA <-c(1, 8, 19, 34)

g_range <- range(0, CCA, CCB)  
plot(CCA, type="o", col="blue", ylim=g_range, axes=FALSE, ann=FALSE, cex=1,cex.axis=1)  
axis(1, at=1:4, lab=c("10000循环*100线程", "2000循环*500线程", "1000循环*1000线程", "500循环*2000线程"),cex.axis = 1)  
lines(CCB, type="o", pch=22, lty=2, col="red")  
axis(2, las=2,at=5*0:7,cex.axis = 1.5)  
box()  
legend(1, g_range[2], c("tomcat","netty"), cex=1.5,col=c("blue","red"), pch=21:22, lty=1:2);

title(ylab=list("耗时ms",cex=1.5))