Learn how to use Dash Bio for next-gen sequencing & quality control. 🧬Register for the Oct 27 webinar.

Unable to change part of the legend size

Hi everyone,

Using R, i would like to increase the size of the bubbles associated to the legend (see the below screenshot, black rectangle) so they could be more visible.

I tried the legend size parameter but it only change the size of the text, not the bubbles

Thanks for your help.

Regards,

Would you mind sharing a reproducible code snippet? I’m suspecting a bug here.

Yes sure, here it is:

Just to be more clear about what i want: i would like to keep the size of the bubble on the map as it is but increase the ones associated to the legend (left part of it).

library(plotly)
g <- list(
scope = ‘world’,
showframe = F,
showcountries =T,
showland = T,
landcolor = rgb(0.960,0.96,0.96)
)

df <- data.frame(rep(0,4),rep(“CHE”,4),rep(0,4))
levels(df[,2]) <- c(“FRA”,“CHE”,“USA”)
df[1,] <- data.frame(1,“FRA”,2010)
df[2,] <- data.frame(2,“USA”, 2010)
df[3,] <- data.frame(2,“FRA”,2011)
df[4,] <- data.frame(2,“USA”,2011)
colnames(df) <-c(“Nbre_complet”,“Code”,“Annee”)

plot_ly(df, type = ‘scattergeo’, mode = ‘markers’, locations = Code,
locationmode = ‘ISO-3’,
text = paste(Nbre_complet, “people”),
color = as.ordered(Annee),
#colors = “YlOrRd”,
colors = c(rgb(0.294,0,0.509),rgb(0.282,0.239,0.545)),
marker = list(size = Nbre_complet, inherit =F)) %>%
layout(title = “My Title”,
geo = g,
legend=list(font =list(size=10))
)

Ok thanks. Could you paste the content of your Annee list?