@@ -26,7 +26,7 @@ library(ggplot2)
26
26
27
27
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
28
28
29
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
29
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
30
30
geom_boxplot()
31
31
32
32
ggplotly(p)
@@ -46,10 +46,10 @@ library(ggplot2)
46
46
47
47
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
48
48
49
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
49
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
50
50
geom_boxplot()
51
51
52
- p + theme(legend.position="bottom")
52
+ p <- p + theme(legend.position="bottom")
53
53
54
54
ggplotly(p)
55
55
```
@@ -62,10 +62,10 @@ library(ggplot2)
62
62
63
63
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
64
64
65
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
65
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
66
66
geom_boxplot()
67
67
68
- p + theme(legend.position = c(0.8, 0.2))
68
+ p <- p + theme(legend.position = c(0.8, 0.2))
69
69
70
70
ggplotly(p)
71
71
```
@@ -83,12 +83,12 @@ library(ggplot2)
83
83
84
84
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
85
85
86
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
86
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
87
87
geom_boxplot()
88
88
89
- p <- p + theme(legend.title = element_text(colour="red", size=10,
89
+ p <- p + theme(legend.title = element_text(colour="red", size=10,
90
90
face="italic"))
91
- p <- p + theme(legend.text = element_text(colour="blue", size=10,
91
+ p <- p + theme(legend.text = element_text(colour="blue", size=10,
92
92
face="bold"))
93
93
94
94
ggplotly(p)
@@ -106,11 +106,11 @@ library(ggplot2)
106
106
107
107
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
108
108
109
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
109
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
110
110
geom_boxplot()
111
111
112
112
p <- p + theme(legend.background = element_rect(fill="lightblue",
113
- size=0.5, linetype="solid",
113
+ size=0.5, linetype="solid",
114
114
colour ="red"))
115
115
116
116
ggplotly(p)
@@ -128,10 +128,10 @@ library(ggplot2)
128
128
129
129
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
130
130
131
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
131
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
132
132
geom_boxplot()
133
133
134
- p + scale_x_discrete(limits=c("2", "0.5", "1"))
134
+ p <- p + scale_x_discrete(limits=c("2", "0.5", "1"))
135
135
136
136
ggplotly(p)
137
137
```
@@ -149,7 +149,7 @@ library(ggplot2)
149
149
150
150
ToothGrowth$dose <- as.factor(ToothGrowth$dose)
151
151
152
- p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
152
+ p <- ggplot(ToothGrowth, aes(x=dose, y=len, fill=dose)) +
153
153
geom_boxplot()
154
154
155
155
p <- p + theme(legend.title = element_blank())
0 commit comments