Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
courses
workshop_git
Commits
9a1243b1
Commit
9a1243b1
authored
Nov 28, 2019
by
virginiemarques
Browse files
assemble plots
parent
dd60e865
Changes
2
Hide whitespace changes
Inline
Side-by-side
.DS_Store
View file @
9a1243b1
No preview for this file type
scripts/script5.R
View file @
9a1243b1
...
...
@@ -4,7 +4,6 @@ library(tidyverse)
library
(
emojifont
)
library
(
grid
)
library
(
ggpubr
)
devtools
::
install_github
(
"hadley/emo"
)
library
(
emo
)
# Load data
...
...
@@ -46,7 +45,6 @@ g1 <- ggplot(df,aes(x=bird_breed,y=n,fill=bird_breed))+
annotate
(
"text"
,
label
=
'Bird of the Year'
,
x
=
3
,
y
=
6000
,
size
=
10
,
# fill ='#fffeea',
colour
=
"white"
)
+
theme
(
plot.background
=
element_rect
(
color
=
'black'
,
fill
=
'black'
),
panel.background
=
element_rect
(
color
=
'black'
,
fill
=
'black'
),
...
...
@@ -136,10 +134,11 @@ map <- ggplot()+
theme
(
plot.background
=
element_rect
(
color
=
'black'
,
fill
=
'black'
),
panel.background
=
element_rect
(
color
=
'black'
,
fill
=
'black'
))
map
# Arrange all plots
all_plots
<-
ggarrange
(
g3
,
g2
,
map
,
ncol
=
3
,
nrow
=
1
,
widths
=
c
(
.8
,
1.5
,
.7
)
)
+
ncol
=
3
,
nrow
=
1
,
widths
=
c
(
.8
,
1.5
,
.7
)
)
+
labs
(
caption
=
paste0
(
"Source: New Zealand Forest and Bird Orginization | by @r0mymendez"
,
emo
::
ji
(
"heart"
)),
subtitle
=
' '
,
title
=
'New Zealand Bird of the Year'
)
+
...
...
@@ -152,7 +151,11 @@ all_plots <- ggarrange(g3, g2,map,
all_plots
# All
all_plots_2
<-
ggarrange
(
g1
,
all_plots
,
ncol
=
1
)
all_plots_2
# Save
ggsave
(
"plots/script5.png"
,
all_plots
,
width
=
1
2
,
height
=
8
)
ggsave
(
"
expected_
plots/script5
_correction
.png"
,
all_plots
_2
,
width
=
1
5
,
height
=
1
8
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment