Plotly chart colours to match the network
This commit is contained in:
6
app.R
6
app.R
@@ -560,9 +560,7 @@ server <- function(input, output, session) {
|
||||
if (nrow(boxPlot) > 0) {
|
||||
|
||||
palette <- brewer.pal(length(legends), "RdYlGn")
|
||||
#print(palette)
|
||||
|
||||
colours <- palette[as.integer(boxPlot$Group)]
|
||||
names(palette) <- 1:length(legends)
|
||||
|
||||
#print(paste("Box plot, colours", nrow(boxPlot), length(colours)))
|
||||
#cat(colours)
|
||||
@@ -570,7 +568,7 @@ server <- function(input, output, session) {
|
||||
categoryarray = boxPlot[,1],
|
||||
zerolinewidth = 10)
|
||||
#
|
||||
plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = colours, colors = palette, type = "box") %>%
|
||||
plot_ly(boxPlot, x = boxPlot[,1], y = ~Range, color = as.character(boxPlot$Group), colors = palette, type = "box") %>%
|
||||
layout(xaxis = xform, showlegend = FALSE, title = title)
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user