[英]how can i create bar chart with non continuous variable in R?
Names=c(1,2,3,4,5,6,7,8)
Series= c(19.5,18.5,11,13,1,5,6,6)
df=c(Names,Series)
ggplot(df,aes(x= Names,y=Series))+geom_col(position="identity",fill="red")
but i have no idea how to make Names to be x-axis since it show weird graph with x axis 0,2.5,5,... 1,2,3,4,5, is not a continuous variable but an indicator I need x axis to be Names and y axis to be Series但我不知道如何使名称成为 x 轴,因为它显示 x 轴 0、2.5、5、... 1、2、3、4、5 的奇怪图形,不是连续变量,而是一个指标 I需要 x 轴为名称,y 轴为系列
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.