画堆积条形图,横轴是日期day,取值有几百个,画出来显示的横轴标签黑成一片,如图,看不清楚。
如何才能显示某几个关键日期,或者以每周/每月的间隔显示日期,请大家帮忙看看,非常感谢!
指令和部分数据如下:
gen a=.
recode a .=1 if classification=="a"
gen b=.
recode b .=1 if classification=="b"
gen c=.
recode c .=1 if classification=="c"
gen day2=date(day,"YMD")
format %td day2
gen day2_text=string(day2,"%td")
egen day2_pos=group(day2)
labmask day2_pos, values(day2_text)
graph bar (count) a b c, over(day2_pos,gap(0)) stack
----------------------- copy starting from the next line -----------------------
------------------ copy up to and including the previous line ------------------