geom_GeomImage() has yet to be implemented in plotly
还没有人认领这个 Issue。
- 主要语言
- R
- 星标
- 2.7k
- 派生
- 641
- PR 合并指标
- 30 天内没有已合并 PR
描述
I am attempting to convert a standard ggplot2 scatterplot to a plotly graph using the ggplotly() function, but the lone caveat of the original scatterplot is that it uses headshots of NFL players for its points, rather than standard dots or other shapes. When I attempt this conversion, I am told that geom_GeomImage() has yet to be implemented in plotly. If it is possible for the plotly package to account for the geom_image() function, that would be fantastic.
Feel free to contact me at jacole@alumni.upenn.edu with any further questions about what I'm asking here.
# Scatterplot using ggplot
# Data frame is called DisguisedPassing_2018to2021_Vs_2022
# headshot_url is a column in the data frame that includes a link to each player's headshot
DisguisedRTG_ScatterPlot <- ggplot(data = DisguisedPassing_2018to2021_Vs_2022) +
geom_image(aes(x = RTG_2018to2021_Disguise, y = RTG_2022_Disguise, image = headshot_url), size = 0.07,
asp = asp_ratio) +
scale_y_continuous(breaks = seq(60, 120, 15)) +
scale_x_continuous(breaks = seq(65, 105, 10)) +
labs(x = "Passer Rating from 2018-21", y = "Passer Rating in 2022",
title = "Passer Rating vs. Disguised Coverages in 2022 and 2018-21",
subtitle = "Among 27 QBs with 75+ Such Attempts in Each Time Span",
caption = "Data from PFF") +
theme_bw() +
theme(plot.title = element_text(size = 10, hjust = 0.5),
plot.subtitle = element_text(size = 8, hjust = 0.5))
# Here's converting the above scatterplot to plotly using ggplotly() function
ggplotly(DisguisedRTG_ScatterPlot)
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先,使用 geom_image() 和 headshot_url aesthetic 复现报告的 ggplotly(DisguisedRTG_ScatterPlot) 转换。确定 plotly.R 支持此 geom 所需的范围,然后验证转换后的散点图能够渲染球员图像,而不是报告 geom_GeomImage() 尚未实现。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- r
- 领域
- data-visualization
- Issue 类型
- 功能
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100