Skip to content
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

Point size as input of orchard_plot() #57

Open
emilio-berti opened this issue Jan 12, 2024 · 1 comment
Open

Point size as input of orchard_plot() #57

emilio-berti opened this issue Jan 12, 2024 · 1 comment

Comments

@emilio-berti
Copy link

I would like to reduce the point size of the orchard_plot for a relatively small figure.

Example code:

library(tidyverse)
library(orchaRd)

set.seed(1230)

st <- expand.grid(sample(LETTERS, 10), sample(LETTERS, 10))
studies <- sapply(seq_len(nrow(st)), \(i) paste0(st[i, 1], st[i, 2]))
d <- tibble(
  x = rnorm(1e2, 5, 2), #effect size
  se_x = rnorm(1e2, 1, .1), #se of effect size
  name = studies, #study ID
  y = sample(letters[1:2], 1e2, replace = TRUE) #cat modulator
)
meta <- rma.mv(
  yi = x,
  V = se_x,
  mods = ~ y - 1,
  random = list(~ 1 | name),
  method = "REML",
  test = "t",
  dfs = "contain",
  data = d
)
p <- orchard_plot(
  object = meta, 
  mod = "y",
  group = "name",
  k = FALSE,
  g = FALSE,
  trunk.size = 5,
  branch.size = 1.5,
  twig.size = .5,
  xlab = "whatever"
)
ggsave("some-path.pdf", p, width = 3, height = 1.5)

orchard-example.pdf

I would like to be able to specify the bubble size range, so that I can make this figure small even for high number of bubbles (e.g., 100 effect sizes) without the bubbles being too big that it becomes hard to see each individual one (as in the figure). Alternatively, a solution in ggplot2 is also welcomed, but I couldn't find one.

@daniel1noble
Copy link
Owner

I can look into this, yes, but this looks like a device size issue as well. If you enlarge your plotting window it will auto adjust everything, then, you can save the figure a certain size. Use dev.size() to get the length and with and you can then add these into ggsave or other plotting windows.

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

2 participants