
x<-seq(-3,3,by=0.5)

y<-4+2*x^2
plot(x,y,type='l')




x<-1:10
y<-2+2*x
plot(x,y)





x<-1:10
y<-2+2*x
plot(x,y,xlab="time",ylab="Income")



x<-seq(-4,4,length=200)
y<-dnorm(x,mean=0,sd=1)
plot(x,y,type="l",lwd=2,col="red")
x<-seq(-4,-2.33,length=200)
y<-dnorm(x,mean=0,sd=1)
polygon(c(-4,x,-2.33),c(0,y,0),col="gray")


attach(mtcars)
x<- matrix(c(1,1,2,3),2, 2, byrow = TRUE)
layout(x,widths=c(3,1),heights=c(1,2))
hist(wt)
hist(mpg)
hist(disp)



a<-expression(alpha[i])
b<-expression(delta[j])
plot(1,1,xlab=a,ylab=b)


pdf("c:/temp/t.pdf")  
plot(sin,-pi,pi)
dev.off() 


setwd("c:/temp")
jpeg('test.jpg')
plot(sin,-pi,pi)
dev.off()



jpeg('test2.jpg', width = 4, height =4, units = 'in', res = 600)
plot(sin,-pi,pi)
dev.off()







rf<-0.16
x<-seq(0,0.7,0.05)
y<-rf+1.7*x
y2<-0.01 +x^0.5+0.2*(x-0.1)
plot(x,y2,type='l',main="Efficient Frontier and
CAPM",xlab=expression
(paste(sigma," (risk)")),ylab="Rp (Portfolio Return)",lwd=4)
lines(x,y,lwd=3)
text(0.09, 0.45, labels=expression("Rm") ,cex = 1)

jpeg('test.jpg', width = 4, height = 4, units = 'in', res = 600)
rf<-0.175
x<-seq(0,0.7,0.05)
y<-rf+1.7*x
y2<-0.01 +x^0.5+0.2*(x-0.1)
plot(x,y2,type='l',main="Efficient Frontier and
CAPM",xlab=expression
(paste(sigma," (risk)")),ylab="Rp (Portfolio Return)",lwd=4)
lines(x,y,lwd=3)
text(0.09, 0.45, labels=expression("Rm") ,cex = 1)
dev.off()


par(bg = "white")
x<-c(0.1,0.3,0.5,0.5,0.7,1)
y<-c(0.1,0.5,0.3,0.7,0.5,1)
plot(x, y,type='n',lwd=0.1,ann=FALSE,axes=FALSE, frame.plot=FALSE)
rect(par("usr")[1], par("usr")[3], par("usr")
[2], par("usr")[4],col= "grey")
text(0.3, 0.7, labels="FINANCIALS") , adj = c(0.2,0),cex = 4)
text(0.3, 0.6, labels="Income Statement", adj = c(0.1,0),cex = 3 )
text(0.3, 0.5, labels="Balance Sheet", adj = c(0.1,0),cex = 3 )
text(0.3, 0.4, labels="Income Cash Flow", adj = c(0.1,0),cex = 3 )




n <- 100
x <- c(0:n, n:0)
y <- c(c(0,cumsum(stats::rnorm(n))), rev(c(0,
cumsum(stats::rnorm(n)))))
plot (x, y, type = "n", xlab = "Time", ylab = "Distance")
polygon(x, y, col = "gray", border = "blue")
title("Distance Between Brownian Motions")















