我使用ggplot2然后使用ggplotly绘制。 但X轴的顺序总是由颜色或形状决定。 我如何以x的字母,而不是颜色或形状的订单? 我的代码如下。 感谢
Plotly地址:https://plot.ly/~jonwenjen/11/bin165-vs-wafer-id/
代码:
library("ggplot2")
library("scales")
library(proto)
library(gsubfn)
library(DBI)
library(RSQLite)
library(sqldf)
library(tcltk)
library(tcltk2)
library(reshape2)
library(tag)
library(shiny)
library(plotly)
test = "select Tracetime,Test_Site,Wafer_id,User,Bin165 from file order by Wafer_id "
d <- read.csv.sql("data.csv", sql = test)
d$Wafer_id <- factor(d$Wafer_id, levels = unique(as.character(d$Wafer_id)))
p <-ggplot(d,aes(x=Wafer_id,y=Bin165, colour = User , group = Wafer_id)) + geom_point(alpha=0.7)
h <- ggplotly (p)
h