我在 R 上有 2 个图表。它们有不同的 x 轴,但趋势概况相似。我如何将它们覆盖在 r 上?

I have 2 graphs on R. They have different x axis, but similar trend profile. how do I overlay them on r?

我有 2 个数据集(第一个和第二个)显示在它们各自的原始数据集上。 它们具有不同的 x 轴,但趋势概况相似。 如何使用 ggplot2 将它们对齐并叠加在 R 上的单个绘图上?

他们在 R 上的绘图代码是:

首先:

 First <- ggplot(data = First,                
                 aes(x, y)) + 
      geom_line(pch = 1)

第二个:

Second <- ggplot(data = Second,                
                 aes(x, y)) + 
      geom_line(pch = 1)

First 的原始数据集:

 x         y   
129.46  532.87
129.44  533.97
129.43  534.48
129.42  524.14
129.40  525.10
129.39  517.73
129.37  517.06
129.36  517.98
129.35  511.68
129.33  506.21
129.32  503.39
129.31  492.87
129.29  484.60
129.28  481.26
129.26  473.19
129.25  469.08
129.24  464.39
129.22  456.28
129.21  452.46
129.19  447.01
129.18  439.83
129.17  434.11
129.15  426.85
129.14  421.21
129.12  414.52
129.11  409.71
129.10  404.59
129.08  399.91
129.07  393.89
129.05  388.65
129.04  383.33
129.03  379.13
129.01  375.56
129.00  370.54
128.98  366.30
128.97  362.54
128.96  356.00
128.94  351.95
128.93  347.81
128.91  343.64
128.90  339.57
128.89  335.33
128.87  331.19
128.86  328.30
128.84  325.86
128.83  323.46
128.82  321.77
128.80  319.47
128.79  316.96
128.77  314.35
128.76  311.30
128.75  308.95
128.73  307.41
128.72  304.59
128.70  302.33
128.69  299.55
128.68  297.95
128.66  296.19
128.65  294.39
128.63  292.42
128.62  289.79
128.61  287.52
128.59  285.54
128.58  283.74
128.57  281.68
128.55  279.89
128.54  278.65
128.52  277.48
128.51  275.45
128.50  273.93
128.48  272.46
128.47  271.14
128.45  269.65
128.44  267.75
128.43  266.05
128.41  264.15
128.40  262.82
128.38  261.77
128.37  261.36
128.36  260.28
128.34  259.67
128.33  258.81
128.31  258.05
128.30  258.05
128.29  257.27
128.27  256.64
128.26  256.02
128.24  254.40
128.23  253.57
128.22  252.97
128.20  252.69
128.19  252.08
128.17  251.61
128.16  250.88
128.15  250.67
128.13  250.52
128.12  249.97
128.10  249.84
128.09  248.82
128.08  249.06
128.06  248.00
128.05  247.06
128.03  246.84
128.02  247.20
128.01  248.07
127.99  247.46
127.98  246.58
127.96  246.86
127.95  247.03
127.94  246.67
127.92  247.20
127.91  247.80
127.90  247.61
127.88  247.87
127.87  247.77
127.85  247.42
127.84  248.48
127.83  248.90
127.81  249.92
127.80  251.29
127.78  252.16
127.77  253.10
127.76  254.39
127.74  255.47
127.73  256.43
127.71  257.68
127.70  258.32
127.69  259.63
127.67  261.89
127.66  263.23
127.64  265.47
127.63  267.10
127.62  269.05
127.60  271.09
127.59  272.48
127.57  274.91
127.56  276.54
127.55  278.50
127.53  279.27
127.52  280.13
127.50  280.96
127.49  281.58
127.48  281.73
127.46  282.27
127.45  282.77
127.43  282.81
127.42  282.59
127.41  282.14
127.39  281.05
127.38  280.53
127.36  279.07
127.35  277.24
127.34  276.30
127.32  274.52
127.31  272.61
127.29  271.43
127.28  270.06
127.27  268.06
127.25  267.17
127.24  265.80
127.23  264.93
127.21  264.38
127.20  263.39
127.18  263.05
127.17  262.48
127.16  261.55
127.14  261.36
127.13  260.32
127.11  259.54
127.10  260.12
127.09  260.55
127.07  260.92
127.06  261.55
127.04  262.40
127.03  262.71
127.02  263.56
127.00  264.18
126.99  264.76
126.97  264.76
126.96  264.48
126.95  265.54
126.93  267.23
126.92  268.28
126.90  269.27
126.89  270.39
126.88  271.40
126.86  272.81
126.85  273.91
126.83  275.63
126.82  277.38
126.81  277.79
126.79  279.41
126.78  279.75
126.76  280.53
126.75  282.72
126.74  284.13
126.72  286.31
126.71  288.78
126.69  290.37
126.68  292.47
126.67  294.45
126.65  296.41
126.64  299.01
126.62  300.27
126.61  300.60
126.60  302.39
126.58  304.41
126.57  306.27
126.56  309.08
126.54  311.47
126.53  314.92
126.51  317.62
126.50  320.79
126.49  324.88
126.47  327.88
126.46  331.98
126.44  334.43
126.43  336.38
126.42  339.31
126.40  342.30
126.39  345.26
126.37  349.00
126.36  353.23
126.35  355.80
126.33  359.43
126.32  362.46
126.30  365.44
126.29  368.90
126.28  371.33
126.26  373.43
126.25  375.84
126.23  376.66
126.22  377.24
126.21  378.86
126.19  380.56
126.18  382.81
126.16  384.93
126.15  386.63
126.14  389.33
126.12  392.04
126.11  393.12
126.09  395.23
126.08  397.14
126.07  397.97
126.05  398.70
126.04  400.18
126.02  402.96
126.01  406.16
126.00  410.46
125.98  414.02
125.97  419.10
125.95  423.51
125.94  429.04
125.93  433.63
125.91  439.10
125.90  445.74
125.88  448.74
125.87  454.18
125.86  458.68
125.84  464.89
125.83  471.47
125.82  479.85
125.80  487.35
125.79  495.42
125.77  505.03
125.76  514.95
125.75  525.05
125.73  536.33
125.72  545.53
125.70  555.22
125.69  566.94
125.68  578.38
125.66  592.60
125.65  610.46
125.63  627.96
125.62  644.92
125.61  667.07
125.59  690.26
125.58  716.45
125.56  743.96
125.55  772.56
125.54  802.98
125.52  834.70
125.51  861.03
125.49  893.29
125.48  928.74
125.47  959.44
125.45  986.00
125.44  1007.16
125.42  1025.04
125.41  1037.34
125.40  1045.97
125.38  1047.54
125.37  1046.52
125.35  1040.06
125.34  1033.93
125.33  1028.62
125.31  1019.46
125.30  1009.75
125.28  998.56
125.27  985.23
125.26  969.51
125.24  954.00
125.23  937.87
125.21  921.84
125.20  904.31
125.19  886.50
125.17  869.52
125.16  855.01
125.15  841.79
125.13  826.35
125.12  812.49
125.10  798.08
125.09  783.09
125.08  768.02
125.06  751.49
125.05  735.61
125.03  720.00
125.02  705.38
125.01  690.72
124.99  676.87
124.98  663.52
124.96  652.62
124.95  642.21
124.94  631.57
124.92  620.73
124.91  609.34
124.89  599.22
124.88  589.48
124.87  578.93
124.85  569.27
124.84  557.89
124.82  548.03
124.81  539.04
124.80  529.46
124.78  520.41
124.77  512.79
124.75  504.41
124.74  494.50
124.73  484.16
124.71  474.33
124.70  463.87
124.68  453.91
124.67  442.96
124.66  432.59
124.64  421.67
124.63  412.34
124.61  402.25
124.60  391.99
124.59  384.48
124.57  375.79
124.56  366.30
124.54  357.78
124.53  349.52
124.52  340.83
124.50  333.56
124.49  324.78
124.48  316.03
124.46  308.79
124.45  301.12
124.43  294.10
124.42  287.40
124.41  280.85
124.39  275.99
124.38  269.42
124.36  264.00
124.35  258.31
124.34  252.82
124.32  248.27
124.31  243.83
124.29  239.23
124.28  234.31
124.27  230.57
124.25  226.70
124.24  222.75
124.22  219.43
124.21  215.93
124.20  212.76
124.18  209.68
124.17  206.41
124.15  203.55
124.14  200.64
124.13  198.50
124.11  196.15
124.10  193.52
124.08  191.50
124.07  189.29
124.06  187.49
124.04  185.83
124.03  184.40
124.01  182.50
124.00  181.13
123.99  179.58
123.97  178.32
123.96  177.52
123.94  176.60
123.93  175.97
123.92  175.14
123.90  174.42
123.89  173.82
123.87  173.33
123.86  172.90
123.85  172.59
123.83  172.14
123.82  171.81
123.80  171.40
123.79  171.32
123.78  171.27
123.76  171.26
123.75  171.29
123.74  171.30
123.72  171.15
123.71  171.20
123.69  171.05
123.68  170.71
123.67  170.44
123.65  170.09
123.64  169.57
123.62  168.99
123.61  168.32
123.60  167.77
123.58  167.32
123.57  166.69
123.55  166.03
123.54  165.45
123.53  164.87
123.51  164.10
123.50  163.33
123.48  162.63
123.47  162.00
123.46  161.37
123.44  160.56
123.43  159.85
123.41  159.23
123.40  158.66
123.39  158.23
123.37  157.77
123.36  157.43
123.34  157.03
123.33  156.67
123.32  156.09
123.30  155.41
123.29  155.02
123.27  154.63
123.26  154.00
123.25  153.36
123.23  152.90
123.22  152.52
123.20  152.22
123.19  151.95
123.18  151.78
123.16  151.64
123.15  151.54
123.13  151.23
123.12  150.99
123.11  150.81
123.09  150.59
123.08  150.38
123.07  150.11
123.05  149.89
123.04  149.75
123.02  149.66
123.01  149.63
123.00  149.83
122.98  150.07
122.97  150.18
122.95  150.38
122.94  150.48
122.93  150.76
122.91  151.21
122.90  151.06
122.88  151.18
122.87  151.47
122.86  151.93
122.84  152.12
122.83  152.41
122.81  152.93
122.80  153.56
122.79  154.44
122.77  155.16
122.76  155.76
122.74  156.56
122.73  157.35
122.72  158.24
122.70  159.00
122.69  159.72
122.67  160.70
122.66  161.41
122.65  162.03
122.63  162.70
122.62  163.31
122.60  163.98
122.59  164.61
122.58  165.13
122.56  165.54
122.55  165.72
122.53  165.78
122.52  165.61
122.51  165.27
122.49  164.97
122.48  164.62
122.46  164.08
122.45  163.49
122.44  162.59
122.42  161.87
122.41  161.26
122.40  160.59
122.38  160.01
122.37  159.52
122.35  158.90
122.34  158.05
122.33  157.02
122.31  156.18
122.30  155.43
122.28  154.64
122.27  153.81
122.26  153.00
122.24  152.30
122.23  151.48
122.21  150.83
122.20  150.15
122.19  149.72
122.17  149.32
122.16  148.91
122.14  148.41
122.13  148.05
122.12  147.78
122.10  147.31
122.09  146.96
122.07  146.90
122.06  146.74
122.05  146.55
122.03  146.53
122.02  147.33
122.00  146.93
121.99  146.75
121.98  146.76
121.96  146.89
121.95  147.08
121.93  147.47
121.92  147.95
121.91  148.47
121.89  148.91
121.88  149.44
121.86  150.03
121.85  150.46
121.84  150.94
121.82  151.46
121.81  152.04
121.79  152.43
121.78  152.67
121.77  152.92
121.75  153.19
121.74  153.50
121.72  153.58
121.71  153.69
121.70  153.81
121.68  153.71
121.67  153.58
121.66  153.20
121.64  152.85
121.63  152.70
121.61  152.24
121.60  151.67
121.59  150.90
121.57  150.41
121.56  149.84
121.54  149.28
121.53  148.58
121.52  148.05
121.50  147.70
121.49  147.15
121.47  146.79
121.46  146.48
121.45  146.24
121.43  145.94
121.42  145.52
121.40  145.30
121.39  145.38
121.38  145.36
121.36  145.28
121.35  145.65
121.33  145.55
121.32  145.75
121.31  146.25
121.29  146.42
121.28  146.81
121.26  147.12
121.25  147.17
121.24  147.47
121.22  147.71
121.21  147.78
121.19  147.95
121.18  148.34
121.17  148.32
121.15  148.54
121.14  148.44
121.12  148.52
121.11  148.70
121.10  148.77
121.08  148.92
121.07  148.95
121.05  148.73
121.04  148.28
121.03  148.15
121.01  147.66
121.00  147.44
120.99  147.17
120.97  146.65
120.96  146.66
120.94  146.30
120.93  146.32
120.92  146.36
120.90  146.05
120.89  146.16
120.87  145.92
120.86  145.57
120.85  145.71
120.83  145.05
120.82  145.49
120.80  145.59
120.79  145.24
120.78  145.48
120.76  146.02
120.75  145.67
120.73  146.44
120.72  147.36
120.71  147.80
120.69  148.87
120.68  147.89
120.66  148.12
120.65  148.79
120.64  147.28
120.62  148.47
120.61  149.10
120.59  149.42
120.58  149.45
120.57  149.90
120.55  150.28
120.54  150.52
120.52  150.43
120.51  150.94
120.50  150.73
120.48  151.13
120.47  151.24
120.45  151.32
120.44  150.96
120.43  150.80
120.41  150.61
120.40  150.41
120.38  150.48
120.37  150.96
120.36  151.60
120.34  152.14
120.33  152.05
120.32  152.51
120.30  152.53
120.29  152.56
120.27  152.63
120.26  152.53
120.25  152.28
120.23  151.96
120.22  150.96
120.20  149.81
120.19  149.15
120.18  148.75
120.16  148.42
120.15  147.90
120.13  147.60
120.12  147.37
120.11  146.73
120.09  146.94
120.08  146.99
120.06  146.53
120.05  146.26
120.04  147.40
120.02  149.56
120.01  148.57
119.99  150.23
119.98  148.50
119.97  149.44
119.95  153.75
119.94  154.59
119.92  158.31
119.91  163.60
119.90  170.53
119.88  176.49
119.87  183.77
119.85  195.72
119.84  199.95
119.83  203.86
119.81  196.98
119.80  186.12
119.78  181.83

第二个是:

  x       y 
142.06  483.07
142.05  481.22
142.03  480.65
142.02  477.31
142.01  469.69
141.99  461.74
141.98  455.80
141.96  450.03
141.95  440.94
141.94  436.92
141.92  439.83
141.91  448.89
141.89  451.64
141.88  445.06
141.87  436.29
141.85  436.91
141.84  439.85
141.82  438.04
141.81  437.54
141.80  440.88
141.78  440.12
141.77  441.93
141.75  441.75
141.74  443.65
141.73  437.05
141.71  435.76
141.70  438.81
141.68  442.95
141.67  445.62
141.66  445.92
141.64  445.68
141.63  441.25
141.62  440.84
141.60  435.75
141.59  429.87
141.57  429.70
141.56  435.20
141.55  434.71
141.53  433.26
141.52  433.86
141.50  435.97
141.49  436.62
141.48  438.29
141.46  436.82
141.45  436.19
141.43  430.53
141.42  425.53
141.41  423.40
141.39  422.70
141.38  427.22
141.36  429.55
141.35  430.31
141.34  433.64
141.32  437.53
141.31  436.35
141.29  436.65
141.28  439.47
141.27  437.66
141.25  436.88
141.24  428.98
141.22  426.74
141.21  431.80
141.20  434.16
141.18  436.85
141.17  439.57
141.15  441.25
141.14  446.21
141.13  445.51
141.11  446.65
141.10  448.60
141.08  445.50
141.07  442.42
141.06  439.73
141.04  437.68
141.03  439.24
141.01  445.00
141.00  446.63
140.99  451.07
140.97  452.34
140.96  453.97
140.94  458.24
140.93  459.39
140.92  462.71
140.90  464.21
140.89  462.70
140.87  462.00
140.86  460.58
140.85  460.49
140.83  464.55
140.82  471.15
140.80  470.22
140.79  472.05
140.78  472.89
140.76  475.38
140.75  478.31
140.73  479.60
140.72  483.60
140.71  486.64
140.69  490.09
140.68  490.27
140.67  490.00
140.65  493.38
140.64  499.44
140.62  499.82
140.61  501.45
140.60  502.86
140.58  503.88
140.57  505.28
140.55  506.91
140.54  511.23
140.53  515.51
140.51  517.53
140.50  517.70
140.48  517.27
140.47  517.27
140.46  514.41
140.44  513.87
140.43  513.18
140.41  510.40
140.40  502.88
140.39  499.08
140.37  494.34
140.36  493.15
140.34  497.87
140.33  499.36
140.32  498.40
140.30  495.46
140.29  490.72
140.27  485.64
140.26  479.75
140.25  474.79
140.23  470.13
140.22  461.47
140.20  459.50
140.19  457.55
140.18  455.43
140.16  461.16
140.15  469.09
140.13  471.04
140.12  469.66
140.11  462.89
140.09  454.46
140.08  448.36
140.06  440.22
140.05  432.27
140.04  424.39
140.02  418.62
140.01  416.53
139.99  414.79
139.98  418.52
139.97  429.46
139.95  439.80
139.94  446.26
139.92  443.80
139.91  438.85
139.90  432.84
139.88  431.29
139.87  427.68
139.85  422.87
139.84  419.23
139.83  414.42
139.81  411.25
139.80  413.78
139.79  419.72
139.77  424.95
139.76  429.25
139.74  427.59
139.73  422.81
139.72  417.27
139.70  416.84
139.69  417.09
139.67  414.80
139.66  412.47
139.65  413.25
139.63  412.05
139.62  416.88
139.60  421.99
139.59  425.06
139.58  434.19
139.56  436.34
139.55  435.10
139.53  430.10
139.52  431.28
139.51  433.26
139.49  434.26
139.48  431.66
139.46  433.82
139.45  436.17
139.44  438.31
139.42  445.14
139.41  452.12
139.39  460.34
139.38  468.53
139.37  469.48
139.35  467.94
139.34  471.17
139.32  475.65
139.31  478.09
139.30  477.27
139.28  478.26
139.27  477.40
139.25  480.09
139.24  485.09
139.23  491.05
139.21  496.55
139.20  500.31
139.18  502.52
139.17  498.99
139.16  497.95
139.14  498.37
139.13  500.68
139.11  503.28
139.10  505.85
139.09  506.35
139.07  507.11
139.06  513.07
139.04  520.05
139.03  527.38
139.02  532.70
139.00  536.39
138.99  541.80
138.97  544.73
138.96  547.06
138.95  551.20
138.93  554.44
138.92  558.82
138.90  564.68
138.89  569.71
138.88  580.95
138.86  593.55
138.85  606.50
138.84  621.86
138.82  632.23
138.81  639.43
138.79  649.10
138.78  661.02
138.77  672.71
138.75  683.65
138.74  697.95
138.72  711.85
138.71  721.70
138.70  742.52
138.68  764.57
138.67  786.43
138.65  812.39
138.64  838.32
138.63  862.37
138.61  882.57
138.60  908.42
138.58  937.86
138.57  962.48
138.56  986.73
138.54  1015.64
138.53  1040.43
138.51  1068.36
138.50  1104.88
138.49  1143.82
138.47  1190.99
138.46  1232.34
138.44  1273.42
138.43  1296.43
138.42  1323.50
138.40  1347.81
138.39  1363.65
138.37  1369.67
138.36  1382.39
138.35  1388.82
138.33  1389.04
138.32  1391.43
138.30  1393.68
138.29  1398.80
138.28  1394.21
138.26  1384.65
138.25  1364.55
138.23  1337.52
138.22  1326.20
138.21  1306.90
138.19  1283.38
138.18  1270.16
138.16  1249.03
138.15  1230.29
138.14  1223.17
138.12  1213.08
138.11  1211.40
138.09  1212.51
138.08  1200.52
138.07  1185.42
138.05  1161.96
138.04  1143.77
138.02  1123.02
138.01  1093.99
138.00  1077.22
137.98  1059.70
137.97  1035.84
137.96  1027.20
137.94  1025.29
137.93  1015.19
137.91  1012.58
137.90  1006.32
137.89  984.20
137.87  964.25
137.86  941.66
137.84  922.75
137.83  906.69
137.82  882.85
137.80  871.76
137.79  857.74
137.77  848.72
137.76  846.38
137.75  839.06
137.73  833.21
137.72  822.04
137.70  804.83
137.69  783.16
137.68  774.40
137.66  758.48
137.65  744.32
137.63  732.52
137.62  722.43
137.61  712.14
137.59  704.13
137.58  699.86
137.56  697.26
137.55  692.86
137.54  684.29
137.52  669.33
137.51  650.79
137.49  639.53
137.48  630.92
137.47  619.08
137.45  607.80
137.44  599.49
137.42  587.80
137.41  579.81
137.40  571.73
137.38  564.87
137.37  559.58
137.35  549.88
137.34  538.16
137.33  525.07
137.31  514.06
137.30  505.49
137.28  497.80
137.27  487.99
137.26  479.18
137.24  470.91
137.23  460.88
137.21  455.19
137.20  448.80
137.19  440.92
137.17  434.03
137.16  424.79
137.14  416.53
137.13  408.00
137.12  401.20
137.10  394.36
137.09  387.62
137.07  380.90
137.06  374.20
137.05  367.24
137.03  360.99
137.02  354.70
137.01  348.64
136.99  342.50
136.98  335.56
136.96  329.23
136.95  322.95
136.94  317.64
136.92  312.24
136.91  308.07
136.89  303.21
136.88  298.65
136.87  293.95
136.85  288.35
136.84  283.98
136.82  280.04
136.81  275.83
136.80  272.23
136.78  268.40
136.77  264.82
136.75  262.04
136.74  259.04
136.73  256.31
136.71  253.72
136.70  250.91
136.68  248.53
136.67  246.17
136.66  243.85
136.64  241.94
136.63  239.81
136.61  238.02
136.60  235.93
136.59  233.98
136.57  232.39
136.56  230.67
136.54  229.24
136.53  227.66
136.52  226.07
136.50  224.55
136.49  222.98
136.47  221.41
136.46  219.70
136.45  218.23
136.43  216.48
136.42  214.75
136.40  213.16
136.39  211.33
136.38  209.93
136.36  208.55
136.35  206.95
136.33  205.56
136.32  204.10
136.31  202.87
136.29  201.66
136.28  200.54
136.26  199.10
136.25  197.71
136.24  196.47
136.22  195.42
136.21  194.51
136.19  193.55
136.18  192.66
136.17  191.81
136.15  191.09
136.14  190.37
136.13  189.78
136.11  189.06
136.10  188.53
136.08  187.81
136.07  187.02
136.06  186.32
136.04  185.86
136.03  185.72
136.01  185.46
136.00  185.06
135.99  184.91
135.97  184.74
135.96  184.66
135.94  184.70
135.93  184.75
135.92  184.67
135.90  184.74
135.89  185.58
135.87  184.94
135.86  184.83
135.85  185.37
135.83  185.96
135.82  186.52
135.80  187.16
135.79  187.97
135.78  188.76
135.76  189.75
135.75  190.56
135.73  191.43
135.72  192.48
135.71  193.43
135.69  194.49
135.68  195.61
135.66  196.96
135.65  198.34
135.64  199.56
135.62  200.90
135.61  202.40
135.59  203.76
135.58  205.23
135.57  206.56
135.55  207.97
135.54  209.31
135.52  210.44
135.51  211.36
135.50  212.20
135.48  212.95
135.47  213.47
135.45  213.92
135.44  214.11
135.43  214.10
135.41  213.94
135.40  213.64
135.38  213.19
135.37  212.59
135.36  211.82
135.34  210.75
135.33  209.66
135.31  208.46
135.30  207.14
135.29  205.82
135.27  204.44
135.26  203.15
135.24  201.80
135.23  200.48
135.22  199.35
135.20  198.28
135.19  197.23
135.18  196.15
135.16  195.07
135.15  194.03
135.13  192.96
135.12  192.21
135.11  191.53
135.09  190.87
135.08  190.32
135.06  190.02
135.05  189.82
135.04  189.84
135.02  189.89
135.01  189.82
134.99  190.02
134.98  189.88
134.97  190.09
134.95  190.45
134.94  190.82
134.92  191.60
134.91  192.45
134.90  193.26
134.88  194.27
134.87  195.37
134.85  196.61
134.84  197.86
134.83  199.11
134.81  200.35
134.80  201.58
134.78  202.68
134.77  203.60
134.76  204.22
134.74  205.07
134.73  206.51
134.71  209.37
134.70  206.97
134.69  207.18
134.67  207.52
134.66  207.90
134.64  208.21
134.63  208.21
134.62  208.27
134.60  207.19
134.59  206.58
134.57  205.72
134.56  204.81
134.55  204.11
134.53  203.64
134.52  202.92
134.50  202.02
134.49  201.22
134.48  200.36
134.46  199.68
134.45  198.92
134.43  198.29
134.42  197.56
134.41  196.73
134.39  196.08
134.38  195.75
134.36  195.52
134.35  195.63
134.34  195.81
134.32  196.02
134.31  196.20
134.30  196.80
134.28  196.90
134.27  197.19
134.25  197.74
134.24  198.08
134.23  198.31
134.21  198.68
134.20  199.22
134.18  199.70
134.17  200.18
134.16  200.93
134.14  201.64
134.13  202.24
134.11  202.68
134.10  203.27
134.09  203.68
134.07  204.09
134.06  204.19
134.04  204.23
134.03  204.12
134.02  204.37
134.00  203.50
133.99  202.88
133.97  202.47
133.96  202.08
133.95  201.85
133.93  201.56
133.92  201.16
133.90  201.05
133.89  200.73
133.88  200.97
133.86  202.35
133.85  201.84
133.83  198.75
133.82  197.11
133.81  196.25
133.79  195.58
133.78  195.22
133.76  195.54
133.75  195.44
133.74  195.13
133.72  195.43
133.71  195.90
133.69  196.28
133.68  196.45
133.67  197.47
133.65  197.88
133.64  199.96
133.62  205.28
133.61  198.80
133.60  196.61
133.58  194.43
133.57  193.35
133.55  191.96
133.54  190.94
133.53  189.94
133.51  188.91
133.50  187.44
133.48  187.05
133.47  200.13
133.46  194.78
133.44  183.44
133.43  183.11
133.41  182.48
133.40  181.97
133.39  184.17
133.37  181.21
133.36  184.86
133.35  183.46
133.33  181.41
133.32  181.87
133.30  182.53
133.29  182.31
133.28  181.29
133.26  181.50
133.25  181.17
133.23  184.41
133.22  183.61
133.21  186.67
133.19  182.59
133.18  181.21
133.16  180.85
133.15  184.65
133.14  184.11
133.12  182.34
133.11  189.83
133.09  190.95
133.08  199.73
133.07  214.60
133.05  223.41
133.04  220.76
133.02  248.98
133.01  296.96
133.00  308.09
132.98  263.16

在此处输入代码

par(mfrow=c(1,2)) 
First 
Second

应该将两者并排绘制,但不要叠加。

根据您希望如何将其可视化,您应该将数据框组合成一个数据框,并将源作为一列。然后要么在同一个地块上使用不同的颜色等,要么使用 facet_wrap。示例:

library(tidyverse)
first <- tibble(x = 1:1000, y = x + runif(1000))
second <- tibble(x = 1001:2000, y = x + runif(1000))

combo <- first %>% 
  mutate(source = "first") %>% 
  bind_rows(
    second %>% 
      mutate(source = "second")
  )


combo %>% 
  ggplot(aes(x,y, colour = source))+
  geom_line()
#or
combo %>% 
  ggplot(aes(x,y))+
  geom_line()+
  facet_wrap(~source)

这些数据看起来像某种光谱,所以我理解将它们绘制在彼此之上以比较形状的愿望。下面的代码对齐每组的峰,但是你会有一个任意的 x-axis(所以我删除了标签)。

first$match <- first$x
second$match <- second$x - second$x[second$y == max(second$y)] + first$x[first$y == max(first$y)]
first$series = "first"
second$series = "second"
all_data = rbind(first, second)
ggplot(all_data) + geom_line(aes(x = match, y, color = series) +
scale_x_continuous(name = "X, arbitrary units") + 
theme(axis.text.x = element_blank())