2013-10-19 1 views
1

데이터 포인트 주변에 플롯 영역을 설정하고 원점에서 두 개를 만날 필요는 없지만 때로는 정확히 그.x 축과 y 축이 (0, 0)에서 만나야합니다.

나는 그리드 패키지와 그것을 달성하기 위해 노력하지만 내가 원하는 것을 얻고 있지 않다 :

require(grid) 
grid.newpage() 
pushViewport(plotViewport(c(5, 5, 5 ,5))) 
pushViewport(dataViewport(1:10, 1:10)) 
grid.points(1:10, 1:10, default.units='native') 
grid.xaxis(at=0:10) 
grid.yaxis(at=0:10) 

enter image description here

방법이이 그리드 시스템과 번체 R 그래픽 시스템 모두에서 할 수 있는가?

답변

1

나는 당신의 문제가 dataViewport에서 확장 인수에서 오는 생각

기본 그래픽에서
require(grid) 
grid.newpage() 
pushViewport(plotViewport(c(5, 5, 5 ,5))) 
pushViewport(dataViewport(0:10, 0:10, extension=c(0,0))) 
grid.points(1:10, 1:10, default.units='native') 
grid.xaxis(at=0:10) 
grid.yaxis(at=0:10) 

,

plot(1:10, 1:10, xaxs="i", yaxs="i", xlim=c(0,10), ylim=c(0,10)) 
관련 문제