plotly / plotly/plotly.R

geom_GeomImage() has yet to be implemented in plotly

Ouverte
#2,294 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Langage dominant
R
Étoiles
2.7k
Forks
641
Métriques de merge des PR
Aucune PR mergée en 30 j

Description


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)

Guide de contribution

Ouvrir le guide de contribution

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Piste de recherche

Commencez par reproduire la conversion signalée de ggplotly(DisguisedRTG_ScatterPlot) avec geom_image() et l’esthétique headshot_url. Déterminez l’ampleur nécessaire pour que plotly.R prenne en charge ce geom, puis vérifiez que le nuage de points converti affiche les images des joueurs au lieu de signaler que geom_GeomImage() n’est pas implémenté.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Évaluation

Stack technique
r
Domaine
data-visualization
Type d'issue
Fonctionnalité
Difficulté
5/5
Temps estimé
Plus d'une semaine
Activité
À l'abandon
Clarté
Plutôt claire
Accessibilité débutants
35/100

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.