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 = "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;")
解决方案
推荐阅读
- python - 如何加载所有扑克牌的图像?
- reactjs - React Bootstrap 下拉菜单
- java - 在列表上执行投影
- mongodb - ESLint 和 TypeScript 在 MongoDB 脚本文件中抱怨
- typescript - 如何在环回 4 中设置浮点类型
- azure - 使用 Azure DevOps Artifact 时无法在 Build Pipeline 中执行“dotnet tool restore --interactive”
- package-managers - 是否有 pkgsrc 命令来“冻结”所有已安装的软件包?
- python - 如何在sqlite查询中将组中的年份组合为10
- node.js - 为什么我的 ctx.request.files 未定义,而 ctx.request.body 没问题?
- javascript - 在进行 fetch 调用时使用请求对象和不使用它们有什么区别?