Skip to content

Add a way to label the plots like A, B, C etc. #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
koundy opened this issue Dec 22, 2017 · 8 comments
Closed

Add a way to label the plots like A, B, C etc. #16

koundy opened this issue Dec 22, 2017 · 8 comments

Comments

@koundy
Copy link

koundy commented Dec 22, 2017

No description provided.

@llrs
Copy link

llrs commented Dec 22, 2017

This has been discussed in issues #1 and #6

This was referenced Jan 14, 2018
@peterchristofferholm
Copy link

As a work-around i ended up using the title as the label and adjust placement accordingly.

theme_set(
  theme_bw() +
    theme(plot.title = element_text(hjust = -0.05, size = 16,
                                    margin = margin(t = -5, b = 1)),
          plot.subtitle = element_text(size = 12))
)

p1 <- p1 + labs(title = "A",
                subtitle = "Distribution of logCPM values before and after filtering")
p2 <- p2 + labs(title = "B", 
                subtitle = "Voom, mean-variance trend")

p1 + p2 + plot_layout(ncol = 1, heights = c(1, 2)) 

image

I think this approach is quite viable and easy to use.

@thomasp85
Copy link
Owner

I'll be awaiting a native ggplot2 solution as proposed here

Following that I'll add a way to automatically add tags to plots with potential knowledge of nesting level - something like:

p1 + p2 + (p3 + p4) + plot_tags(format = c('A', '1'), suffix = ')')

which would add the following tags:

p1: A)
p2: B)
p3: C1)
p4: C2)

Already added tags would be overwritten

@adrfantini
Copy link

Now that tags are implemented in ggplot, do you plan to provide a plot_tags function? (ora maybe it's there already and I'm missing it?)

@thomasp85
Copy link
Owner

It’s there already in the plot_annotation function

@adrfantini
Copy link

Got it, thanks!

@rmflight
Copy link
Contributor

There is an open pull request to add the plot_annotation to the README #64

@efratushava
Copy link

It’s there already in the plot_annotation function

Can you please give an example of how to use tag level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants