Can you implement geom_GeomTextNpc() in plotly ?
Nessuno ha ancora preso questa issue.
- Lingua principale
- R
- Stelle
- 2.7k
- Fork
- 641
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
Hi,
I'm using the package ggpmisc to display on ggplot graphique the R² and equation of regression thanks to ggpmisc::stat_poly_eq().
This is working well when I am plotting the ggplot graphic. But when I want to use the function ggplotly() to display the graphic, the R² and the equation disappear.
I receive this messages :
Warning message:
In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) :
geom_GeomTextNpc() has yet to be implemented in plotly.
If you'd like to see this geom implemented,
Please open an issue with your example code at
https://github.com/ropensci/plotly/issues
If you have the time, and the desire to implement geom_GeomTextNpc() in plotly, it could be super nice.
I give you a small code to reproduce the problem
#Data cration
df<-tibble(a=c(2,6,3,4,10),
b=c(3,6,9,12,15))
df
#relation
myFormula<- y ~ poly(x,2,raw = TRUE)
#ggplot
df_plot<-ggplot(data = df,aes(x = a,y = b))+
geom_point()+
geom_smooth(method = lm,
formula = myFormula)+
ggtitle("polynomial 2")+
#from here problem with ggplotly
ggpmisc::stat_poly_eq(
aes(label=paste("atop(",stat(rr.label),",",
stat(eq.label),")",
sep="")),
formula = myFormula,parse = TRUE)
df_plot
#plotly
ggplotly(df_plot)
The ggplot graphic :

And here the graphic with plotly:

Thank you for creating and implementing plotly 👍
Best,
Fanny
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con l’avviso geom2trace.default per geom_GeomTextNpc() ed esegui la riproduzione fornita ggplotly(df_plot). Traccia il modo in cui ggplotly converte i layer di ggplot2, quindi determina l’implementazione necessaria per questo geom. Il lavoro è completato quando l’avviso scompare e nel grafico interattivo compaiono R² e l’equazione di regressione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- plotly, r
- Ambito
- data-visualization
- Tipo di issue
- Funzionalità
- Difficoltà
- 5/5
- Tempo stimato
- Più di una settimana
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 35/100