Browsed by
Tag: theme_grey()

In R STUDIO, how to apply the same font type and size in ggplot?

In R STUDIO, how to apply the same font type and size in ggplot?

First, let’s generate a simple data. Then I’ll make a bar graph using ggplot2. Now, I made a bar graph like above, but in the code to make this bar graph, I repeated font type and size over and over to set up the same font type and size in both graph title and text (also in x and y axis). I want to reduce this repeated codes, and the solution is using theme_grey(). axis.title.x= element_text (family=”serif”, size=15, color=”black”), axis.title.y=…

Read More Read More

Modifying Graph Axis Style using ggplot in R Studio

Modifying Graph Axis Style using ggplot in R Studio

This is a method for adjusting the axis formatting of a graph drawn using ggplot() in R Studio. I will create a simple dataset as shown below. Next, I will use this data to create a bar graph. I have created the bar graph as shown above. Now, let’s proceed to adjust the axis formatting of the graph. 1) Setting Axis Range I will adjust the range of the y-axis values. I want to set the range from -1 to…

Read More Read More