문제

R.Table ()을 R에서 기존 플롯에서 사용하고 싶지만 차트의 오른쪽에있는이 테이블을 찾을 수 없습니다.그래서 그 일은 다음과 같습니다 :

무엇보다도, 나는 내 데이터의 막대 그래프를 만듭니다 :

hist(as.numeric(unlist((vels[counts]))),freq=F,
  col="gray",border="black",ylim=c(0,0.15),
  xlab=paste(names(vels)[counts]),
  main=paste("Weibull fitting",names(vels[counts])))
.

그 후에, 나는 기존 차트에서 플롯을 구현 한 기능을 구현했다. 모두를 부여하는 Weibull 곡선

plot_weibull(K_value,A_value)
.

그리고 마침내 나는 매우 예쁜 형태의 셀을 보여주기 때문에 grid.table ()을 사용하여 data.table ()을 사용하여 프레임을 배치하고 셀에서 기울임 꼴 및 굵은 글씨를 사용할 수 있습니다.

grid.table(round(values,3),cex=0.75,show.rownames=T,
  show.colnames=T,show.hlines=T)
.

이 테이블은 히스토그램과 곡선 앞에있는 장치의 중앙에 나타나는 것입니다. 나는 그것을 오른쪽에있게하고 싶습니다.

결국 그래프를 클릭하는 도구를 알고 싶습니다. 내 Weibull 곡선 아래 영역을 받게됩니다.

도움이 되었습니까?

해결책

The hist function is base graphics and the grid.table function is grid graphics. The 2 graphics systems do not play nicely together without extra effort (as you have noticed).

The easiest fix is to use the addtable2plot function from the plotrix package rather than grid.table. It may not look the same but it would be simple.

Another option is to use a grid graphics function to create the histogram, such as something from the lattice or ggplot2 packages (both can do histograms), then create a specific viewport using grid graphics functions and use grid.table to put the table into that viewport.

Last, if you really want to mix them then see the gridBase package for ways to mix grid and base graphics.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top