plotly / plotly/plotly.R

stat_function used to draw a density function not implemented

Open
#1,987 0 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
R
Stars
2.7k
Forks
641
PR merge metrics
No merged PRs in 30d

Description

Hi. I am using ggplot to draw density functions. Tried to convert the ggplot to a plotly graph using ggplotly and got the message to open an issue since the geom_GeomFunction() has yet to be implemented in plotly. So here is an example hoping that you can implement this geom that use stat_function:

library(pacman)
p_load(tidyverse)

mm<-70
sdm<-12
weight_lim<-c(30, 110)
p1<-ggplot(data = data.frame(weight = weight_lim), aes(weight)) +
  stat_function(fun = dnorm, n = 101, args = list(mean = mm, sd = sdm),color=1)
ggplotly(p1)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by running the provided R example with stat_function(fun = dnorm) and ggplotly, then trace how ggplotly handles the unimplemented geom_GeomFunction(). Done means the density function converts to an interactive Plotly graph without the unimplemented warning.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.