I have a dataframe and using the following code to generate the plot:
df2 <- data.frame(a=c(02, 04, 08, 16, 32, 64, "all"), china=c(0.61,0.63,0.67,0.65, 0.65,0.67, 0.67)) library(ggplot2) theme_set( theme_classic() + theme(legend.position = "top") ) p <- ggplot(data = df2, aes(x = a, y = china, group = 1)) # Basic line plot with points p + geom_line() + geom_point() # Change line type and color p + geom_line(linetype = "dashed", color = "steelblue")+ geom_point(color = "steelblue")
I am getting this plot:
Please see that the values in x-axis are not arranged in ascending order which I actually want. Hoiw can I get that done? Can anyone please help me?