r - 如何将回归线添加到 gganimate 图中?
问题描述
我想在我的 gganimate 图中添加一条回归线。如果没有回归线,gganimate 绘图按预期工作,当我将 geom_smooth 命令添加到常规绘图时,它工作正常。当我尝试将回归线添加到 gganimate 图中时,我只会收到错误消息。
g <- ggplot(pdata, aes(x = ole, y = rsv)) +
geom_point(aes(color = region)) +
geom_smooth(aes(group = region, color = region), se = FALSE)
anim <- g + transition_states(region, transition_length = 3, state_length = 5)
anim
我收到错误消息:
geom_smooth()` using method = 'loess' and formula 'y ~ x'
`geom_smooth()` using method = 'loess' and formula 'y ~ x'
Error in transform_path(all_frames, next_state, ease, params$transition_length[i], :
transformr is required to tween paths and lines
解决方案
推荐阅读
- php - 如何在 magento 2 的可配置产品页面上添加自定义 phtml 文件
- amazon-web-services - 未调用 AWS API Gateway 自定义授权方
- c++ - 通过霓虹灯实现灰度图像的opencv均值函数
- docker - Docker 步骤结果到日志文件 - Jenkins
- c# - Bamboo 显示测试用例为 0,即使应用程序中有测试用例
- javascript - 给定一个整数数组返回正数,其中存在等效的负数
- elasticsearch - Elasticsearch 中的一个自定义分析器中的多个标记器
- android - 当应用程序在 Oreo 的前台时启动服务时出现 IllegalStateException
- javascript - JavaScript - 获取浏览器支持的语言环境的完整列表
- python - 两个列表和声明