plotly / plotly/plotly.R

plotly problem of specifying point symbol within the boxplot

Open
#1,716 0 comments 0 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 trying to specify the point symbol (shape) based on a factor, so that the point shape within the boxplot can be different (which can be very useful for highlighting a group of points). However, it looks like instead of showing different shapes, the third boxplot got split into two boxes.

Can you please advise how to achieve that?


Brief description of the problem

library(dplyr)
data(iris)
iris=mutate(iris, Petal.Width_high=ifelse(Petal.Width>2,"High","Low"))

iris %>% plot_ly(x = ~ Species, y = ~ Petal.Width, color= ~ Species,
                 symbol = ~ Petal.Width_high,
                 type = "box", mode="markers",boxpoints="all",
                 jitter = 0.4, marker = list(size = 10),
                 pointpos = 0,hoverinfo='text',
                 text= ~paste('</br>Species: ', Species,
                              '</br>Petal.Width: ', Petal.Width))

image

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 reproducing the supplied R example with iris, plot_ly, boxpoints="all", and symbol mapped to Petal.Width_high. Investigate why the symbol mapping splits the third boxplot, and consider the issue done when different point symbols render within each box without changing the box grouping.

Written by the indexing model from the issue text.

Assessment

Tech stack
r
Domain
data-visualization
Issue type
Bug
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.