简体   繁体   中英

Modify x axis labels

I'm using this code in R to graph the following variables:

> ggplot(NDVI, aes(x = Mision, y= MEAN))+
+     geom_point(stat = "summary")

which produces the following plot:

评估作物NDVI值的散点图

As you can see, the x-axis shows a point in time where NDVI for the crop was evaluated. However, it does not display the full set of numbers (1 - 8). It's displaying only the even numbers. How do I tell ggplot that I want the x axis to show the lables for all of the missions?.

The x axis corresponds to a discrete set of numbers. We performed multiple missions where we collected data and each mission was labeled 1 - 8; missions 2 and 5 do not have data because on those sorties there was not data collected.

This is my data: https://github.com/escalante-cr/NDVI_calculation

将其添加到代码末尾即可达到目的:

+ scale_x_continuous(breaks = c(seq(8)))

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM