@@ -114,7 +114,8 @@ p2 = ggplot(subset(diamonds, carat > 2.2 & depth > 55 & depth < 70),
114
114
115
115
## NPG
116
116
117
- The NPG palette is inspired by the plots in journals published by Nature Publishing Group:
117
+ The NPG palette is inspired by the plots in journals published by
118
+ Nature Publishing Group:
118
119
119
120
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
120
121
p1_npg = p1 + scale_color_npg()
@@ -124,8 +125,8 @@ grid.arrange(p1_npg, p2_npg, ncol = 2)
124
125
125
126
## AAAS
126
127
127
- The AAAS palette is inspired by the plots in journals published by American Association
128
- for the Advancement of Science:
128
+ The AAAS palette is inspired by the plots in journals published by
129
+ American Association for the Advancement of Science:
129
130
130
131
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
131
132
p1_aaas = p1 + scale_color_aaas()
@@ -135,7 +136,8 @@ grid.arrange(p1_aaas, p2_aaas, ncol = 2)
135
136
136
137
## NEJM
137
138
138
- The NEJM palette is inspired by the plots in <emph >The New England Journal of Medicine</emph >:
139
+ The NEJM palette is inspired by the plots in
140
+ <emph >The New England Journal of Medicine</emph >:
139
141
140
142
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
141
143
p1_nejm = p1 + scale_color_nejm()
@@ -145,7 +147,8 @@ grid.arrange(p1_nejm, p2_nejm, ncol = 2)
145
147
146
148
## Lancet
147
149
148
- The Lancet palette is inspired by the plots in Lancet journals, such as <emph >Lancet Oncology</emph >:
150
+ The Lancet palette is inspired by the plots in Lancet journals, such as
151
+ <emph >Lancet Oncology</emph >:
149
152
150
153
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
151
154
p1_lancet = p1 + scale_color_lancet()
@@ -155,7 +158,8 @@ grid.arrange(p1_lancet, p2_lancet, ncol = 2)
155
158
156
159
## JCO
157
160
158
- The JCO palette is inspired by the the plots in <emph >Journal of Clinical Oncology</emph >:
161
+ The JCO palette is inspired by the the plots in
162
+ <emph >Journal of Clinical Oncology</emph >:
159
163
160
164
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
161
165
p1_jco = p1 + scale_color_jco()
@@ -183,22 +187,10 @@ The D3 palette is from the categorical colors used by
183
187
There are four palette types (` category10 ` , ` category20 ` ,
184
188
` category20b ` , ` category20c ` ) available.
185
189
186
- ``` {r, fig.width = 10.67, fig.height = 16 , out.width = 800, out.height = 1200 , dpi = 150}
190
+ ``` {r, fig.width = 10.67, fig.height = 4 , out.width = 800, out.height = 300 , dpi = 150}
187
191
p1_d3 = p1 + scale_color_d3()
188
192
p2_d3 = p2 + scale_fill_d3()
189
- p1_d3_c10 = p1 + scale_color_d3("category10")
190
- p2_d3_c10 = p2 + scale_fill_d3("category10")
191
- p1_d3_c20 = p1 + scale_color_d3("category20")
192
- p2_d3_c20 = p2 + scale_fill_d3("category20")
193
- p1_d3_c20b = p1 + scale_color_d3("category20b")
194
- p2_d3_c20b = p2 + scale_fill_d3("category20b")
195
- p1_d3_c20c = p1 + scale_color_d3("category20c")
196
- p2_d3_c20c = p2 + scale_fill_d3("category20c")
197
- grid.arrange(p1_d3_c10, p2_d3_c10,
198
- p1_d3_c20, p2_d3_c20,
199
- p1_d3_c20b, p2_d3_c20b,
200
- p1_d3_c20c, p2_d3_c20c,
201
- ncol = 2, nrow = 4)
193
+ grid.arrange(p1_d3, p2_d3, ncol = 2)
202
194
```
203
195
204
196
## LocusZoom
@@ -219,36 +211,23 @@ The IGV palette is from the colors used by
219
211
for representing chromosomes. There are two palette types
220
212
(` default ` , ` alternating ` ) available.
221
213
222
- ``` {r, fig.width = 10.67, fig.height = 8 , out.width = 800, out.height = 600 , dpi = 150}
214
+ ``` {r, fig.width = 10.67, fig.height = 4 , out.width = 800, out.height = 300 , dpi = 150}
223
215
p1_igv_default = p1 + scale_color_igv()
224
216
p2_igv_default = p2 + scale_fill_igv()
225
- p1_igv_alternate = p1 + scale_colour_manual(
226
- values = rep(pal_igv("alternating")(2), times = 3))
227
- p2_igv_alternate = p2 + scale_fill_manual(
228
- values = rep(pal_igv("alternating")(2), times = 3))
229
- grid.arrange(p1_igv_default, p2_igv_default,
230
- p1_igv_alternate, p2_igv_alternate,
231
- ncol = 2, nrow = 2)
217
+ grid.arrange(p1_igv_default, p2_igv_default, ncol = 2)
232
218
```
233
219
234
220
## UChicago
235
221
236
222
The UChicago palette is based on
237
223
[ the colors] ( http://communications.uchicago.edu/identity/color-palette )
238
- used by The University of Chicago.
239
- There are three palette types (` default ` , ` light ` , ` dark ` ) available.
224
+ used by The University of Chicago. There are three palette types
225
+ (` default ` , ` light ` , ` dark ` ) available.
240
226
241
- ``` {r, fig.width = 10.67, fig.height = 12 , out.width = 800, out.height = 900 , dpi = 150}
227
+ ``` {r, fig.width = 10.67, fig.height = 4 , out.width = 800, out.height = 300 , dpi = 150}
242
228
p1_uchicago = p1 + scale_color_uchicago()
243
229
p2_uchicago = p2 + scale_fill_uchicago()
244
- p1_uchicago_light = p1 + scale_color_uchicago("light")
245
- p2_uchicago_light = p2 + scale_fill_uchicago("light")
246
- p1_uchicago_dark = p1 + scale_color_uchicago("dark")
247
- p2_uchicago_dark = p2 + scale_fill_uchicago("dark")
248
- grid.arrange(p1_uchicago, p2_uchicago,
249
- p1_uchicago_light, p2_uchicago_light,
250
- p1_uchicago_dark, p2_uchicago_dark,
251
- ncol = 2, nrow = 3)
230
+ grid.arrange(p1_uchicago, p2_uchicago, ncol = 2)
252
231
```
253
232
254
233
## Star Trek
@@ -283,7 +262,8 @@ grid.arrange(p1_rickandmorty, p2_rickandmorty, ncol = 2)
283
262
284
263
## The Simpsons
285
264
286
- This palette is inspired by the colors used in the TV show <emph >The Simpsons</emph >:
265
+ This palette is inspired by the colors used in the TV show
266
+ <emph >The Simpsons</emph >:
287
267
288
268
``` {r, fig.width = 10.67, fig.height = 4, out.width = 800, out.height = 300, dpi = 150}
289
269
p1_simpsons = p1 + scale_color_simpsons()
@@ -300,7 +280,7 @@ to demonstrate the continuous color palettes in `ggsci`.
300
280
library("reshape2")
301
281
302
282
data("mtcars")
303
- cor = cor(mtcars)
283
+ cor = cor(unname(cbind( mtcars, mtcars, mtcars, mtcars)) )
304
284
cor_melt = melt(cor)
305
285
306
286
p3 = ggplot(cor_melt,
0 commit comments