2次元プロット

  • 予定パッケージ名
    • RYMiscellaneous
  • 関数名
    • RY2dplot
  • タイトル
RY2dplot
  • 説明
2次元プロット
  • 使用例
RY2dplot(x,y,fx)
  • ソース
RY2dplot<-function(x,y,FUN,FUN2=image,...){
	xy<-expand.grid(x,y)
	z<-FUN(xy[,1],xy[,2])
	FUN2(x,y,matrix(z,length(x),length(y),byrow=TRUE),...)
	#image(x,y,matrix(z,length(x),length(y),byrow=TRUE))
}
  • 使用例
x<-seq(from=0,to=1,by=0.01)
y<-seq(from=2,to=4,by=0.01)
f1<-function(x,y){cos(x)+sin(y)}
RY2dplot(x,y,f1,persp,theta=30,phi=20)
RY2dplot(x,y,f1)
RY2dplot(x,y,f1,filled.contour)