How do I adjust the origin of the axes (x,y) to the points (0,0) using ggplot in Rstudio?

Asked

Viewed 10 times

0

PLOT: VARIATION OF VISCOSITY

Visc_M5 <- read.csv("VISCOSIDADE.csv", header = T, sep = ";")

g1 <- ggplot(Visc_M5) + aes(x=Uexp)+
  geom_line(aes(y=Pexp, col = "Experimental"), size = 1.1)

Visc2 <- g1 +
  geom_line(aes(x=V.5, y=Visc_P1, col = "Viscosity(0.00001)"), size = 1.1)

Visc3 <- Visc2 +
  geom_line(aes(x=V.4, y=Visc_P2, col = "Viscosity(0.0001)"), size = 1.1)

Visc4 <- Visc3 +
  geom_line(aes(x=V.3, y=Visc_P3, col = "Viscosity(0.001)"), size = 1.1)

Visc4 +
  scale_color_manual(values = c("black","blue","green","red"))+
  labs(x="Displacement (mm)", y="Load (kN)", colour = NULL) +
  theme_classic()+
   theme(axis.title = element_text(size = 12),
        axis.text = element_text(size = 12, color = "black"),
        legend.text = element_text(size = 14))+
  theme(legend.position = c(0.8,0.15))+
  scale_x_continuous(limits = c(0,15), breaks = seq(0,15,5))+
  scale_y_continuous(limits = c(0,750), breaks = seq(0,750,250))+
  theme(axis.line = element_line(colour = "black"))
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.