plotly / plotly/plotly.R

Retrieve max count from Histogram

Open
#559 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

The idea is to create a histogram plot and draw a vertical line of the mean of the data over the histogram.

a=runif(100); p <- plot_ly(x=a,type="histogram")

then add a trace

p %>% add_trace(x=c(mean(a),mean(a)),y=c(0,maxCount),mode="lines",name="Mean")

The point is that maxCount is available only when the histogram chart is created

Any suggestion?

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 with the plot_ly histogram and add_trace example in the issue, then trace how histogram data is created and exposed. Done means a user can obtain the histogram's maximum count and use it as the vertical line's y value when adding the mean trace.

Written by the indexing model from the issue text.

Assessment

Tech stack
plotly, r
Domain
data-visualization
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.