Browsed by
Tag: geom_abline ()

Drawing Lines in ggplot()

Drawing Lines in ggplot()

When using ggplot() to create multiple graphs, there are times when you might want to add separate lines to the graphs. Today, I’ll be posting about how to draw additional lines on graphs. Let’s start by generating a simple piece of data. Next, I will proceed to draw a regression graph for this data. 1) Drawing a 1:1 ratio line. To examine the slope of the regression line, I would like to draw a 1:1 ratio line. geom_abline (slope=1, linetype…

Read More Read More

Enhancing Graph Points in R Studio: Adding Distinct Borders

Enhancing Graph Points in R Studio: Adding Distinct Borders

I have datasets below. This data pertains to the differences in grain yield and height resulting from various fertilizer treatments. Now I’ll create a graph using the following code. Since I assigned the color based on the condition of the “Fertilizer,”; geom_point (aes(color=Fertilizer)), the colors are automatically distinguished, resulting in the graph being plotted. However, I would like to add borders to these points in order to represent them more distinctly. By the way, if you include shape=Fertilizer within aes(),…

Read More Read More