ヒストグラムをマージする。

> a
[1] 3.6733549 2.0964979 3.0578191 3.3848866 2.2321731 1.5372021 3.2570364
[8] 3.0096714 2.0811907 3.0736826 2.9830515 1.9655211 1.6236944 0.5570966
[15] 3.8051724 3.7394164 1.6979833 2.5249300 2.1315488 2.8377696 2.6262853
[22] 1.6636081 2.4337812 4.3043109 0.6420680 2.9023796 3.4974585 2.1955692
[29] 2.7694304 3.4286484 4.5740029 3.0867829 3.5141311 4.2614741 3.4994524
[36] 4.4216530 1.9077288 3.9496659 1.2188855 3.2530465 3.8250476 2.5062853
[43] 1.3137912 3.8042755 2.5910803 4.0694347 1.7310610 2.5695329 0.7099829
[50] 2.7493290 2.5259095 2.5362651 1.6126841 5.0531126 3.2696924 2.2706000
[57] 2.7724084 3.0419279 2.9403198 3.8163018 3.2626065 3.8119257 1.8410985
[64] 2.9244953 2.9789564 1.5516710 3.0739347 2.6266789 3.7997618 3.4434447
[71] 3.2613312 2.8807292 4.0660146 2.2689740 3.0968824 2.2202709 4.6028309
[78] 2.3118259 1.1906384 5.0521038 3.2620226 1.5232411 2.7185332 2.6115882
[85] 3.7125138 2.4887761 2.5080909 2.8311246 2.2069350 3.8966891 2.8455420
[92] 3.6973981 1.8070504 1.9947025 4.4664127 2.0546780 3.4273880 1.7457909
[99] 1.4936952 3.8016075
> b
[1] -4.134144 -3.306181 -4.054554 -3.946141 -4.192023 -2.712701 -3.464084
[8] -4.896416 -2.205163 -2.939116 -3.159373 -2.199980 -2.507629 -2.221705
[15] -1.606201 -1.115522 -2.872009 -2.150897 -3.812835 -2.492953 -1.694000
[22] -1.478684 -3.806212 -2.799230 -3.005081 -3.773754 -1.582478 -4.036486
[29] -4.246356 -2.162980 -2.255924 -4.195940 -3.897398 -1.690358 -1.854960
[36] -3.604445 -3.505798 -1.551523 -4.411737 -3.553468 -1.490395 -2.852557
[43] -1.864107 -2.773118 -3.719723 -3.776232 -2.632725 -1.164422 -4.968988
[50] -2.241084 -1.706101 -2.205303 -3.946153 -3.145719 -3.209761 -2.703878
[57] -2.904665 -4.341992 -3.728479 -2.759898 -2.193844 -1.475450 -3.278501
[64] -2.812560 -2.894497 -1.898953 -4.899581 -2.649229 -3.229953 -2.713525
[71] -1.392737 -3.047104 -3.758222 -2.624436 -5.149499 -4.368148 -1.329522
[78] -2.484047 -4.539421 -3.385670 -3.045505 -4.533926 -3.210328 -1.879037
[85] -3.324745 -3.075046 -4.099899 -1.614997 -3.089391 -2.219660 -3.098115
[92] -1.604445 -2.464664 -2.617909 -1.781988 -3.817595 -4.564343 -4.926086
[99] -3.179107 -3.962524

> png("merge.png")

> #axeは軸を入れるかどうかのオプション。最初のヒストグラムにはいれない。ただし、表示領域を固定しておくこと。でないと、次のヒストグラムとずれてします。
> hist(a, ann=T,axe=F,xlim=c(-10,10),ylim=c(0,20),col="red",density=5)

> #これでマージしてくれます。
> par(new=T)

#今度は座標情報を入れます。
> hist(b, ann=T,axe=T,xlim=c(-10,10),ylim=c(0,20),col="green",density=5)
> dev.off()