-
Notifications
You must be signed in to change notification settings - Fork 632
Closed
Description
I used to be able to run the following code to render the plot containing stat_function() interactive (it was actually used with renderPlotly in a shiny app, but I tried to keep it simple and reproductible) before updating to the latest versions of R Studio and Plotly:
p <- ggplot(data = data.frame(x = 0), mapping = aes(x = x)) +
stat_function(fun = function(x) x^2+3) +
stat_function(fun = function(x) 5) +
xlim(1, 5)
ggplotly(p)
Now it throws the error 1: In geom2trace.default(dots[[1L]][[1L]], dots[[2L]][[1L]], dots[[3L]][[1L]]) : geom_GeomFunction() has yet to be implemented in plotly.
.
chrismiddleton and v-vieira
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
Select code repository
Activity
superjai commentedon Nov 18, 2020
Hi @cpsievert! How about I give this issue a go?
wanga02 commentedon Mar 12, 2021
Hi all! Has this been resolved? I am having the same issue and can't find a workaround - would appreciate an update on this / would like to bump the issue. Thanks!
Kezrael commentedon Mar 15, 2021
Far from an elegant workaround, but if it helps you, I'm mapping my function over a sharp enough grid and using geom_line() to represent it. Hope it gets sorted out though.
wanga02 commentedon Mar 31, 2021
Ooh @Kezrael would love to see an example / understand more clearly what you mean by that? I'm trying to figure out a workaround at the mo!
v-vieira commentedon Jul 9, 2021
Until this issue is not solved, one workaround is to use a previous version of ggplot2.
To me, the version 3.1.1 worked smoothly.
Hope this issue is solved soon.
Closes plotly#1872. Implemented to_basic for `geom_function`
Merge pull request #2042 from moutikabdessabour/implement_geomFunction
Plotly june2022 (#18)