Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c9966f8

Browse files
author
Joseph Damiba
authored
Merge pull request #17 from plotly/update-violin-plot
make sure example violin plots are colored correctly
2 parents 9905d6c + 7aba626 commit c9966f8

File tree

1 file changed

+6
-18
lines changed

1 file changed

+6
-18
lines changed

r/2018-01-16-violin.Rmd

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -116,9 +116,7 @@ p <- df %>%
116116
meanline = list(
117117
visible = T
118118
),
119-
line = list(
120-
color = 'blue'
121-
)
119+
color = I("blue")
122120
) %>%
123121
add_trace(
124122
x = ~day[df$sex == 'Female'],
@@ -132,9 +130,7 @@ p <- df %>%
132130
meanline = list(
133131
visible = T
134132
),
135-
line = list(
136-
color = 'pink'
137-
)
133+
color = I("pink")
138134
) %>%
139135
layout(
140136
yaxis = list(
@@ -168,9 +164,7 @@ p <- df %>%
168164
meanline = list(
169165
visible = T
170166
),
171-
line = list(
172-
color = 'blue'
173-
)
167+
color = I("blue")
174168
) %>%
175169
add_trace(
176170
x = ~day[df$smoker == 'No'],
@@ -185,9 +179,7 @@ p <- df %>%
185179
meanline = list(
186180
visible = T
187181
),
188-
line = list(
189-
color = 'green'
190-
)
182+
color = I("green")
191183
) %>%
192184
layout(
193185
xaxis = list(
@@ -239,9 +231,7 @@ for (i in 1:length(unique(df$day))) {
239231
meanline = list(
240232
visible = T
241233
),
242-
line = list(
243-
color = "#8dd3c7"
244-
),
234+
color = I("#8dd3c7"),
245235
marker = list(
246236
line = list(
247237
width = 2,
@@ -269,9 +259,7 @@ for (i in 1:length(unique(df$day))) {
269259
meanline = list(
270260
visible = T
271261
),
272-
line = list(
273-
color = "#bebada"
274-
),
262+
color = I("#bebada"),
275263
marker = list(
276264
line = list(
277265
width = 2,

0 commit comments

Comments
 (0)