Skip to content

color by for one half only #15

@ScaonE

Description

@ScaonE

Dear all,

I'd like to be able to specify a color only for the 2nd half of the plot.
See "reprex" below :

# Not specifying a color, all goes well
ggplot(
  ToothGrowth %>%
    mutate(across(dose, as.character)),
  aes(x = dose, y = len)
) + 
  geom_half_boxplot() +
  geom_half_point() +
  theme_bw()

A

# Color is specified & taken into account for geom_half_point, but alignment is not suitable
ggplot(
  ToothGrowth %>%
    mutate(across(dose, as.character)),
  aes(x = dose, y = len)
) + 
  geom_half_boxplot() +
  geom_half_point(aes(color = supp)) +
  theme_bw()

B

My current issue is that some points are now over the boxplot. I'd like them to stay all on the right-hand side of the boxplot. Any tips ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions