Guest User

Untitled

a guest
Jun 18th, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. rm(list = setdiff(ls(), lsf.str()))
  2. require(graphics)
  3. library(latex2exp)
  4. Linear<-c( 1,0.983666667,0.967333333,0.951,0.934666667,0.918333333,0.902,0.885666667,
  5. 0.869333333,0.853,0.836666667,0.820333333,0.804,0.787666667,0.771333333,
  6. 0.755,0.738666667,0.722333333,0.706,0.689666667,0.673333333,0.657,0.640666667,
  7. 0.624333333,0.608,0.591666667,0.575333333,0.559,0.542666667,0.526333333,0.51)
  8. SqRt<-c( 1 , 0.910538649 , 0.873482544 , 0.845048395 , 0.821077298 ,
  9. 0.799958338 , 0.780865338 , 0.763307513 , 0.746965088 , 0.731615947 ,
  10. 0.717098368 , 0.703290265 , 0.690096789 , 0.677442512 , 0.665266275 ,
  11. 0.653517677 , 0.642154596 , 0.6311414 , 0.620447632 , 0.610047011 ,
  12. 0.599916675 , 0.590036587 , 0.580389069 , 0.570958432 , 0.561730676 ,
  13. 0.552693245 , 0.543834825 , 0.535145184 , 0.526615026 , 0.518235881 , 0.51 )
  14. CubeRt<-c( 1 , 0.842124513 , 0.801135304 , 0.772387515 , 0.749504067 , 0.730181506 ,
  15. 0.71329249 , 0.698190887 , 0.684467813 , 0.671846185 , 0.660128536 ,
  16. 0.649168592 , 0.638854625 , 0.629099142 , 0.619832193 , 0.610996874 ,
  17. 0.602546197 , 0.59444086 , 0.586647616 , 0.579138061 , 0.571887715 ,
  18. 0.56487531 , 0.558082241 , 0.551492126 , 0.545090459 , 0.538864322 ,
  19. 0.532802159 , 0.526893586 , 0.521129232 , 0.515500609 , 0.51 )
  20.  
  21. g_range <- range(0, Linear, SqRt,CubeRt,na.rm = TRUE)
  22. plot(Linear, type="l",lwd=2, col="blue", ylim=g_range,
  23. axes=FALSE, ann=FALSE,lty=1)
  24. axis(1, at=c(0,5,10,15,20,25,30))
  25.  
  26. axis(2, las=1)
  27.  
  28. box()
  29. lines(SqRt, type="l", pch=22, lty=1,lwd=2, col="red")
  30. lines(CubeRt, type="l", pch=24, lty=1,lwd=2, col="black")
  31.  
  32. title(xlab="mmh/RH", col.lab=rgb(0,0,0))
  33. title(ylab="Availability, $hat{A}_o$", col.lab=rgb(0,0,0))
  34.  
  35. plot_colors <- c("blue","red", "black")
  36. text <- c("Linear", "Square Root", "Cube Root")
  37. #legend(x=14, y=1.0, legend=text, fill=plot_colors, ncol=3, xpd=NA)
  38. legend('topright', legend=TeX("Linear, m=1","Square Root", "Cube Root"),
  39. fill=plot_colors, ncol=3, xpd=NA)
Add Comment
Please, Sign In to add comment