我从移动的仪器通过水中获取了一些数据。仪器在Z字形路径中穿过水流,并且每0.5秒记录一次流量数据。我需要制作一个图表,显示沿仪器路径的流量。所选流量值范围(比如0.1 -1.5)和所有异常值的不同颜色(颜色渐变)。
如何使用R绘制图表?这是我的一些数据:
idNr flow dep
27 0.288261301 4.04
28 0.321201425 3.96
29 0.348002863 4.05
30 0.266207609 3.98
31 0.344623682 3.98
32 0.33590977 4.02
33 0.333196711 3.98
34 0.443371838 4.08
35 0.751650508 4.35
36 1.026660332 5.15
37 1.79303221 6.52
38 1.804413243 8.04
39 1.773816905 9.55
40 1.782303493 10.99
41 1.726813914 12.49
42 1.61061413 13.95
43 1.747734972 15.44
44 1.619344989 16.88
45 1.527087967 18.37
46 1.552443997 19.84
47 1.580849856 21.36
48 1.47038517 22.8
49 1.392708417 24.28
50 1.56442883 25.78
51 1.777948528 27.22
52 1.802147241 28.7
53 1.87299915 30.2
54 2.053852522 31.7
55 1.642625947 33.18
56 1.427217507 34.62
57 1.52030689 36.05
58 1.417431073 37.55
59 1.443192082 39.1
60 1.34374145 40.56
61 1.421155629 42.01
62 1.333494728 43.58
63 1.3194019 45.03
64 1.394158603 46.62
65 1.429844828 48.08
66 1.367911241 49.58
67 1.355840925 51.02
68 1.378465281 52.55
69 1.523250886 53.91
70 1.365535668 55.61
71 1.396372615 57.04
72 1.347452677 58.57
73 1.382778102 60.02
74 1.455112272 61.48
75 1.350807161 63.02
76 1.386283066 64.42
77 1.390035765 65.97
78 1.383424985 67.4
79 1.395385154 68.96
80 1.381371239 70.49
81 1.400707773 71.98
82 1.476066775 73.48
83 1.284056739 75.03
84 1.475329288 76.46
85 1.459387313 78.01
86 1.465585987 79.61
87 1.431249165 81.19
88 1.357601114 82.55
89 1.382301557 84.12
90 1.445689198 85.61
91 1.36922513 87.16
92 1.520221768 88.68
93 1.498713299 90.21
94 1.598120373 91.74
95 1.434218834 93.23
96 1.526169617 94.77
97 1.53240429 96.32
98 1.593795786 97.73
99 1.60067114 99.26
100 1.699682725 100.85
101 1.656267698 102.39
102 1.688246548 103.97
103 1.665317693 105.45
104 1.710451732 106.94
105 1.558604843 108.5
106 1.682163929 109.96
107 1.754686611 111.43
108 1.451731985 112.94
109 1.75889143 114.49
110 1.578577562 115.98
111 1.660725181 117.43
112 1.638376473 119.05
113 1.701685385 120.54
114 1.603928968 122.06
115 1.716673882 123.55
116 1.721613119 125.04
117 1.520097264 126.52
118 1.673504264 128.04
119 1.651535476 129.54
120 1.716307179 131.06
121 1.661417444 132.56
122 1.807044943 134.09
123 1.670927777 135.61
124 1.816092103 137.15
125 1.61581054 138.66
126 1.443289015 140.17
127 1.548887918 141.65
128 1.742922886 143.19
129 1.407817467 144.64
130 1.537282981 146.2
131 1.605707701 147.66
132 1.595514766 149.11
133 1.664969522 150.64
134 1.597832102 152.2
135 1.656365329 153.63
136 1.475701825 155.17
137 1.584298389 156.64
138 1.511851004 158.09
139 1.81195684 159.64
140 1.429699891 161.16
141 1.453907433 162.64
142 1.583450822 164.13
143 1.670092861 165.61
144 1.564082726 167.12
145 1.705749786 168.64
146 1.617373325 170.1
147 1.705749786 171.67
148 1.750116174 173.24
149 1.612112174 174.71
150 1.543739041 176.19
151 1.658449408 177.8
152 1.544094384 179.26
153 1.660865163 180.72
154 1.718616091 182.32
155 1.652198157 183.8
156 1.663230727 185.21
157 1.760015837 186.74
158 1.543345815 188.16
159 1.518992563 189.66
160 1.719743279 191.14
161 1.871325988 192.63
162 1.338309201 194.15
163 1.834802202 195.66
164 1.900303456 197.19
165 1.789994802 198.73
166 1.641265789 200.15
167 1.711407354 201.66
168 1.777665955 203.12
169 1.650013219 204.61
170 1.752274015 206.09
171 1.769734944 207.59
172 1.63480019 209.04
173 1.67727874 210.53
174 1.661860415 212.01
175 1.670834431 213.51
176 1.875008828 214.91
177 1.198086144 216.41
178 1.473233127 217.84
179 1.401750052 219.35
180 1.465064864 220.81
181 1.507361683 222.31
182 1.594120168 223.76
183 1.603827938 225.28
184 1.836556292 226.72
185 1.778422956 228.19
186 1.644971831 229.7
187 1.803737202 231.17
188 1.828251113 232.68
189 1.762103594 234.16
190 1.659823074 235.6
191 1.894313483 237.05
192 1.814170041 238.56
193 1.887235594 239.99
194 1.941720868 241.54
195 1.948726387 242.95
196 1.563589543 244.41
197 2.066101568 245.9
198 1.880538604 247.35
199 1.728849162 248.83
答案 0 :(得分:0)
以下是y轴上idNr的图形,x轴上的dep,流程为颜色:
ddf$flowgrp = with(ddf, cut(flow, 10))
ggplot(ddf, aes(y=idNr, x=dep, color=flowgrp))+ geom_point(size=5)
我不确定这是否是你需要的。它与您为x和y轴提供的数据不能成为锯齿形。