Actually I have searched a lot and I could not find a solution for this problem.
I have a data like df1 and df2
df1<- structure(list(V1 = c(925.2, 929.055, 932.91, 936.765, 940.62,
944.475, 948.33, 952.185, 956.04, 959.895, 963.75, 967.605, 971.46,
975.315, 979.17, 983.025, 986.88, 990.735, 994.59, 998.445, 1002.3,
1006.155, 1010.01)), .Names = "V1", class = "data.frame", row.names = c(NA,
-23L))
the df1 is the wavelength and the same size in lenght as df2
df2<- structure(list(V1 = c(1.2138218, 1.20229547, 1.19370594, 1.18406585,
1.17474114, 1.1659916, 1.15794742, 1.1504168, 1.14266249, 1.13331046,
1.12056388, 1.1027684, 1.07916047, 1.05045274, 1.01889485, 0.98764698,
0.95964186, 0.93640246, 0.91734136, 0.89985375, 0.88016878, 0.8546364,
0.8210004), V2 = c(1.1944769, 1.2044156, 1.1958914, 1.1863521,
1.177123, 1.1683985, 1.1602467, 1.1524525, 1.1443126, 1.1345368,
1.1214308, 1.1034221, 1.0797777, 1.0511821, 1.0198132, 0.9887466,
0.9608482, 0.9376109, 0.9184564, 0.9008158, 0.880963, 0.855286,
0.8215516), V3 = c(1.192471, 1.1854642, 1.1773381, 1.1682578,
1.1595011, 1.1513092, 1.1438045, 1.1367952, 1.1295544, 1.1207314,
1.1085633, 1.0914286, 1.0685784, 1.040708, 1.0100161, 0.9795931,
0.9523085, 0.9296534, 0.9110514, 0.8939461, 0.8746324, 0.8495194,
0.8163846), V4 = c(1.2000113, 1.1833215, 1.1753832, 1.166816,
1.1587624, 1.1512878, 1.1443524, 1.1376584, 1.1304499, 1.1214213,
1.1089041, 1.0913883, 1.0682224, 1.0401648, 1.0094345, 0.9791035,
0.9519961, 0.9295479, 0.9111335, 0.8941637, 0.8749218, 0.8498227,
0.8166596), V5 = c(1.202633, 1.1907639, 1.1825598, 1.1735177,
1.1648682, 1.1567665, 1.1492625, 1.142129, 1.1346457, 1.125498,
1.1129647, 1.0954514, 1.0722142, 1.0439373, 1.0128083, 0.9819197,
0.9541607, 0.9310512, 0.912038, 0.8945685, 0.8749184, 0.8494622,
0.8159423), V6 = c(1.215689, 1.1933457, 1.1850756, 1.1759209,
1.1671304, 1.1588694, 1.1511887, 1.1438567, 1.1361504, 1.126759,
1.1139725, 1.0962136, 1.0727591, 1.0443134, 1.0130784, 0.9821486,
0.9543992, 0.9313219, 0.9123303, 0.894846, 0.8751373, 0.8495936,
0.8159881)), .Names = c("V1", "V2", "V3", "V4", "V5", "V6"), class = "data.frame", row.names = c(NA,
-23L))
df2 is the intensity and is a measurment data, Now I have tried to use plot(df1,df2) or vice versa but it does not plot it.