r - 使用 tooltip="text' 选项时如何显示拟合线文本?
问题描述
问题: 当我使用 tooltip="text" 时,适合的蓝线的文本消失了。我希望能够在数据点上显示自定义文本并让文本出现在蓝线上,而不仅仅是置信区间(灰色区域)。
代码:
library("plotly")
library("ggplot2")
p <- ggplot(mtcars, aes(wt, mpg, text = row.names(mtcars))) +
geom_point() + geom_smooth(method="lm", aes(x=mtcars$wt, y=mtcars$mpg), formula=y~poly(x,2), inherit.aes=FALSE)
ggplotly(p +geom_smooth(se=FALSE), tooltip="text")
解决方案
推荐阅读
- microcontroller - 动态 PWM 占空比
- c - 动态数组和扫描字符串的 ANSI C 问题
- airflow - 我应该如何在 CustomOperator 和 PythonOperator 之间进行选择?
- selenium - 在 zalenium 会话之间保持缓存
- php - PHP - 如何查询 JSON 文件的多个值?
- file - 找到文件夹并将内容复制到新文件夹,
- database - 如何使用 MongoDB 将数据插入文件?
- excel - 在单元格块中查找重复值
- php - 使用 PHP 重新流式传输 Shoutcast/Icecast 流
- .net - 异常“对 *.svc 的 HTTP 请求已超过分配的超时...”是什么类型的异常?