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.
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.
You can get around it with adding group = 1: This removes the error. However, I did not check if your overall approach to this plot makes sense (see comments). Regarding why group = 1 is necessary: I would recommend this chapter in R for Data Science.
Perhaps it’s because you have only one y axis, using your way. Did you try something like this?
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
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
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.
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.
The scale_fill_hue() function can take a h.start= parameter to choose where you pick the first color (as described on the ?scale_fill_hue help page)
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
this happened to me and i discovered that the arial font file had been disabled. first check to see if Arial.ttf has been moved to the disabled fonts directory. from the terminal: if so, move it back to the active fonts directory. log out, log in, then open the ‘Font Book’ application. in my case, arial was … Read more