[R] two plots super-impose

Sébastien pomchip at free.fr
Thu Aug 2 20:15:37 CEST 2007


Hi Philip,

par(new=TRUE) before your hist(y) lines should do the trick.

You may have to modify some settings in case the axes are not overlayed 
perfectly.

Sebastien

Philip.He at sanofi-aventis.com a écrit :
> Dear R users,
>
> I used plot(x,y) to draw a scatter plot. I need to add another smaller
> histogram on the same plot I just had. However when I used hist(y), the
> histogram was on another page. 
>
> Any suggestion?
>
> Best Regards,
>
> Philip
>
>
> 	[[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
>
>



More information about the R-help mailing list