increase legend font size ggplot2

You can use theme_get() to display the possible options for theme. You can control the legend font size using: replacing X with the desired size.

ggplot geom_text font size control

Here are a few options for changing text / label sizes The size in the geom_text changes the size of the geom_text labels. For this And why size of 10 in geom_text() is different from that in theme(text=element_text()) ? Yes, they are different. I did a quick manual check and they appear to be in the ratio of ~ (14/5) for geom_text sizes to theme sizes. … Read more

Position-dodge warning with ggplot boxplot?

The number of groups is not the problem; I can see the same thing even when there are only 2 groups. The issue is that ggplot2 draws boxplots vertically (continuous along y, categorical along x) and you are trying to draw them horizontally (continuous along x, categorical along y). Also, your example has several syntax errors and … Read more

Increase number of axis ticks

You can override ggplots default scales by modifying scale_x_continuous and/or scale_y_continuous. For example: Gives you this: And overriding the scales can give you something like this: If you want to simply “zoom” in on a specific part of a plot, look at xlim() and ylim() respectively. Good insight can also be found here to understand the other arguments as well.

Center Plot title in ggplot2

From the release news of ggplot 2.2.0: “The main plot title is now left-aligned to better work better with a subtitle”. See also the plot.title argument in ?theme: “left-aligned by default”. As pointed out by @J_F, you may add theme(plot.title = element_text(hjust = 0.5)) to center the title.

Editing legend (text) labels in ggplot

The tutorial @Henrik mentioned is an excellent resource for learning how to create plots with the ggplot2 package. An example with your data: this results in: As mentioned by @user2739472 in the comments: If you only want to change the legend text labels and not the colours from ggplot’s default palette, you can use scale_color_hue(labels = c(“T999”, “T888”)) instead … Read more