Skip to content

scale_*_continuous name parameter not working #63

@londonrsteele

Description

@londonrsteele

Hi!

Here's my snippet:

figure <- stats_summary_sorted_df %>%
  ggplot(aes(x=`Avg Dups (%)`, y=`Unique Aligned (%)`)) +
  # main plot
  geom_point(size=3) +
  scale_x_continuous(
    expand=c(0,0),
    limits=c(0,100),
    breaks=c(0,10,20,30,40,50,60,70,80,90,100),
    labels=function(x) paste0(x, "%", sep="")
  ) +
  scale_y_continuous(
    expand=c(0,0),
    limits=c(0,100),
    breaks=c(0,10,20,30,40,50,60,70,80,90,100),
    labels=function(x) paste0(x, "%", sep="")
  ) +
  labs(
    x="Average Duplicate Reads (%)",
    y="Unique Aligned Reads (%)",
    title="American Kestrel 2023 General Alignement Statistics"
  ) +
  # ggside plots
  ggside(
    x.pos = "top",
    y.pos = "right",
    respect_side_labels = "all"
  ) +
  geom_xsidedensity(aes(y=after_stat(density), fill=viridis(2)[1])) +
  geom_ysidedensity(aes(x=after_stat(density), fill=viridis(2)[2])) +
  scale_xsidey_continuous( # top
    name="Density (%)",
    expand=c(0,0),
    limits=c(0,0.06),
    labels=scales::percent,
    minor_breaks=NULL
  ) +
  scale_ysidex_continuous( # right
    name="Density (%)",
    expand=c(0,0),
    limits=c(0,0.06),
    labels=scales::percent,
    minor_breaks=NULL
  ) +
  theme_bw() +
  theme(
    axis.line=element_line(color="black",
                           linewidth=1.0,
                           linetype=1),
    plot.title=element_text(margin=margin(b=25, unit="pt"), hjust=0.5),
    plot.margin=unit(c(25,25,25,25),"pt"),
    axis.title.x=element_text(margin=margin(t=8, unit="pt")),
    axis.title.y=element_text(margin=margin(r=10, unit="pt")),
    legend.position="none",
    ggside.panel.spacing=unit(20,"pt"),
  )
figure

I can NOT get name to work! I'd like "Density (%)" to show up as an axis label for the ggside plots.

Thanks!
London

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