I am trying to create a series of spineplots. Spineplots (user-written, ssc spineplot) show categories as fractions of a total and by default, the range of the y-axis is set to 0 to 1.
My variable rut_cat2 has three categories but I am only interested in showing two of those (and I set the color of the last category to white). Since their fraction is relatively small, I want to restrict the range of the y-axis to show 0 to 0.2. Is there any way to do this?
My variable rut_cat2 has three categories but I am only interested in showing two of those (and I set the color of the last category to white). Since their fraction is relatively small, I want to restrict the range of the y-axis to show 0 to 0.2. Is there any way to do this?
Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input float(sex_couple_age rut_cat2)
2 3
2 2
4 3
4 1
4 3
5 2
2 1
3 3
1 3
3 2
1 2
4 3
5 3
3 3
4 1
1 3
4 2
1 3
3 1
4 3
end
label values sex_couple_age sex_couple_age
label def sex_couple_age 1 "Single men", modify
label def sex_couple_age 2 "Partnered men", modify
label def sex_couple_age 3 "Single women", modify
label def sex_couple_age 4 "Partnered women", modify
label def sex_couple_age 5 "Elderly single men", modify
label def sex_couple_age 6 "Elderly partnered men", modify
label def sex_couple_age 7 "Elderly single women", modify
label def sex_couple_age 8 "Elderly partnered women", modify
label values rut_cat2 rut_cat2
label def rut_cat2 3 "Non-user", modify
spineplot rut_cat2 sex_couple_age, bar3(color("110 142 132")) bar2(color("192 220 192")) bar1(color(white)) barall(blwidth(tiny) blcolor(white)) ///
ylabel(none, noticks axis(1)) ///
xlabel(none, noticks axis(1)) xlabel(, angle(45) axis(2)) ///
xtitle("") xtitle("", axis(2)) ytitle("", axis(2)) legend(off) plotregion(margin(zero)) graphregion(margin(vsmall) c(white)) xsize(4)

Comment