简体   繁体   English

如何使用x轴订购function

[英]How to use the x-axis to order the function

Hi I am using ggplot2 to create a scatter graph.嗨,我正在使用 ggplot2 创建散点图。 For some reason it keeps using the y-axis variables to order my scatter graph.出于某种原因,它一直使用 y 轴变量来排序我的散点图。 I'm new to this so I barely know what I'm doing, so if someoen could help, would be much appreciated!我是新手,所以我几乎不知道自己在做什么,所以如果有人能提供帮助,将不胜感激!

What I've noticed is that my Rstudio orders the numbers going in order like 1,10,11,12...2,21,22,23 instead of going the standard 1,2,3,4,5,6,7我注意到的是,我的 Rstudio 按 1、10、11、12...2、21、22、23 的顺序排列数字,而不是标准的 1、2、3、4、5、6, 7

Diesel_Prices_Jan19 <- ggplot(Prices_4, aes(V4, V1))
Diesel_Prices_Jan19 + geom_point()

图片

As a tip its probably best to give a good reprex.作为提示,最好给出一个好的reprex。 Check the type of that column and maybe try turning it into a factor检查该列的类型,也许尝试将其变成一个因素

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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