167
167
A3
168
168
```
169
169
170
- ![ A1] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_A1.png )
170
+ ![ A1] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_A1.png )
171
171
172
- ![ A2] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis/ Results/08_A2 .png )
172
+ ![ A2] ( https://github.com/cxli233/Quick_data_vis /blob/main/ Results/08_A_2 .png )
173
173
174
- ![ A3] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_A3.png )
174
+ ![ A3] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_A3.png )
175
175
176
176
### The design of the composite
177
177
To create a composite, we use the ` wrap_plots() ` function from ` patchwork ` .
@@ -202,7 +202,7 @@ wrap_plots(A1, A2, A3,
202
202
ggsave("../Results/08_A_1.png", height = 6, width = 6)
203
203
```
204
204
205
- ![ A_1] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_A_1.png )
205
+ ![ A_1] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_A_1.png )
206
206
207
207
The way ` wrap_plots() ` matches sub-panel names to parts A, B, and C is by the order.
208
208
In this case, the first sub-panel name (A1) provided is part A, and so on.
@@ -224,7 +224,7 @@ wrap_plots(A1, A2, A3,
224
224
ggsave("../Results/08_A_2.png", height = 6, width = 6)
225
225
```
226
226
227
- ![ A_2] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_A_2.png )
227
+ ![ A_2] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_A_2.png )
228
228
229
229
For example, vector ` c(0.3, 1) ` passed on to the ` widths ` option specifies that the 1st column should be 0.3 of the width of the 2nd column.
230
230
Notice we only 2 rows and columns, so the heights and widths vectors each have 2 numbers.
@@ -252,7 +252,7 @@ Panel_A
252
252
ggsave("../Results/08_A.png", height = 6, width = 6)
253
253
```
254
254
255
- ![ A] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_A.png )
255
+ ![ A] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_A.png )
256
256
257
257
Now we have panel A!
258
258
@@ -267,9 +267,9 @@ Panel_B
267
267
Panel_C
268
268
```
269
269
270
- ![ B] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_B.png )
270
+ ![ B] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_B.png )
271
271
272
- ![ C] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_C.png )
272
+ ![ C] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_C.png )
273
273
274
274
Let's say we want panel A and panel B to be in the left column, panel C alone take up the entire right column, what should the design argument be?
275
275
``` {r}
@@ -295,7 +295,7 @@ Again, we can control that by calling `widths = ` and `heights = ` within `wrap_
295
295
ggsave("../Results/08_assembled.png", height = 7, width = 8)
296
296
```
297
297
298
- ![ assembled] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_assembled.png )
298
+ ![ assembled] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_assembled.png )
299
299
300
300
Now we are really close.
301
301
Notice that only panel A is labeled?
@@ -317,7 +317,7 @@ We just need to append `+ labs(tag = "B")` and `+ labs(tag = "C")` to the respec
317
317
ggsave("../Results/08_assembled_label.png", height = 7, width = 8)
318
318
```
319
319
320
- ![ assembled_labeled] ( https://github.com/cxli233/Online_R_learning /blob/master/Quick_data_vis /Results/08_assembled_label.png )
320
+ ![ assembled_labeled] ( https://github.com/cxli233/Quick_data_vis /blob/main /Results/08_assembled_label.png )
321
321
322
322
Done!
323
323
Great, we have a publication ready figure!
0 commit comments