plotly_build modifies legend and labels
问题 I have a problem when transforming a ggplot2 graph to plotly. Here it is a reproducible code: library(ggplot2) library(plotly) # Build the data dgraf<-data.frame(num=seq(0,2*pi,length.out=100), name=sample(apply(expand.grid(letters,letters),1,function(x) paste(x,collapse="\n")),100),stringsAsFactors = F) dgraf$y<-sin(dgraf$num) rpoint<-sample(25:75,1) dgraf$ypoint<-NA dgraf$ypoint[rpoint]<-dgraf$y[rpoint] dgraf$ymin<-NA dgraf$ymin[1:rpoint]<-runif(1,0.25,0.75) dgraf$ymax<-NA dgraf$ymax[rpoint