Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/r/66.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
R ggplot2-不确定如何去除交互式绘图上的线条_R_Ggplot2 - Fatal编程技术网

R ggplot2-不确定如何去除交互式绘图上的线条

R ggplot2-不确定如何去除交互式绘图上的线条,r,ggplot2,R,Ggplot2,我的绘图添加了连接数据点的线,但我只希望数据点没有连接线。如何更改代码以使连接点的线消失?下面是我的代码和插入数据后的绘图 ucsplot <- ggplot(data1()$dfplot, aes(data1()$ucs,data1()$depth)) + annotate("rect", xmin=0, xmax=3700, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "

我的绘图添加了连接数据点的线,但我只希望数据点没有连接线。如何更改代码以使连接点的线消失?下面是我的代码和插入数据后的绘图

ucsplot <- ggplot(data1()$dfplot, aes(data1()$ucs,data1()$depth)) +   
    annotate("rect", xmin=0, xmax=3700, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "blue", alpha = 0.2)+
    annotate("rect", xmin=3700, xmax=7000, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "gray50", alpha = 0.2)+
    annotate("rect", xmin=7000, xmax=15000, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "green", alpha = 0.2)+
    annotate("rect", xmin=15000, xmax=35000, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "darkorange", alpha = 0.2)+
    annotate("rect", xmin=35000, xmax=475000, ymin=max(data1()$dfplot[,1])+10, ymax=min(data1()$dfplot[,1])-15, fill = "red", alpha = 0.2) +
    geom_path() + xlab("UCS (psi)") + ylab("Depth (ft)") + labs(title=paste(data1()$well[1], " Depth vs. UCS", sep="")) +
    theme(plot.title = element_text(hjust=0.5)) +
    geom_point_interactive(aes(tooltip = data1()$dfplot[,1], data_id = data1()$dfplot[,1]), size = .75) +
    scale_x_continuous(position = "top", limits = c(0, max(data1()$dfplot[,3]+5000)), expand=c(0,0)) +
    scale_y_reverse(limits = c(max(data1()$dfplot[,1])+10, min(data1()$dfplot[,1])-15 ), expand = c(0, 0)) +
    geom_text(aes(x=1850, y=min(data1()$dfplot[,1]-10), label="Very Weak"), size=3) +
    geom_text(aes(x=5350, y=min(data1()$dfplot[,1]-10), label="Weak"), size=3) +
    geom_text(aes(x=11000, y=min(data1()$dfplot[,1]-10), label="Fair"), size=3) +
    geom_text(aes(x=25000, y=min(data1()$dfplot[,1]-10), label="Strong"), size=3) +
    geom_text(aes(x=41250, y=min(data1()$dfplot[,1]-10), label="Very Strong"), size=3)

ggiraph(code = print(ucsplot), hover_css = "cursor:pointer;fill:red;stroke:red;")

ucsplot删除
geom\u path()
layer如果我删除
geom\u path()
层,那么我的数据将不会以我希望的原始顺序显示?这很奇怪,你能添加一些数据来制作一个示例图(不一定是全部)吗?我们可以解决所有的绘图顺序问题。这是一个相当长的程序,在shiny中,所以我不确定我是否能提供数据。只需显示一个有代表性的数据子集,我们不需要整个shiny应用程序,我们不需要你的全部数据。只需给我们10-20行数据,与
dput()共享即可,因此它是可复制/粘贴的。