Ask Your Question
2

How can the text size of the plot be enlarged using ggcuminc?

asked 2023-02-02 11:00:00 +0000

ladyg gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-10-19 13:00:00 +0000

bukephalos gravatar image

To enlarge the text size of the plot in ggcuminc, you can add the "theme" function and adjust the "axis.text" and "axis.title" arguments. For example:

library(ggplot2)
library(ggcuminc)

# create data
df <- data.frame(x = rpois(100, 5), y = rpois(100, 5))

# plot cumulative incidence
ggcuminc(df, "x", "y")

# enlarge text size
ggcuminc(df, "x", "y") +
  theme(axis.text = element_text(size = 12),
        axis.title = element_text(size = 14))

In the above example, we added the "theme" function and adjusted the text size of the x and y axis labels using the "axis.title" argument and the text size of the tick labels using the "axis.text" argument. You can adjust the size to your preferred value.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-02-02 11:00:00 +0000

Seen: 10 times

Last updated: Oct 19 '21