Hi,
I am trying to do a simple graph with plot() function.
When I do the plot with two columns of the data.frame the style options dosen't work. But in lines() function it works well.
I don't jnow th reason. Is there something wrong in my code.
dataf <- data.frame(producto=c("P1","P2","P3","P4","P5","P6","P7","P8"),
ventas = c(20,20,10,30,40,30,10,40),
presup = c(25,18,11,32,34,30,12,30)
)
plot(dataf$producto, dataf$ventas,type="p", col="blue", ylim=c(0,50), main="Ventas por producto")
# the type="p" and color = "blue" doesn't work
lines(dataf$presup, type="l", col="blue")
# type and color works properly
I am trying to do a simple graph with plot() function.
When I do the plot with two columns of the data.frame the style options dosen't work. But in lines() function it works well.
I don't jnow th reason. Is there something wrong in my code.
dataf <- data.frame(producto=c("P1","P2","P3","P4","P5","P6","P7","P8"),
ventas = c(20,20,10,30,40,30,10,40),
presup = c(25,18,11,32,34,30,12,30)
)
plot(dataf$producto, dataf$ventas,type="p", col="blue", ylim=c(0,50), main="Ventas por producto")
# the type="p" and color = "blue" doesn't work
lines(dataf$presup, type="l", col="blue")
# type and color works properly