Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to modify the by-option's label of -slideplot-

    Dear Stata users,
    I used Nick Cox's -slideplot- command (SSC) to draw some kind of bar plot. The author reminds us that -slideplot hbar- will make it easier to identify names or labels of categories, however, sometimes I prefer to use vertical displays with a classcial -bar- type. This choice naturally gives rise to problems that long value labels are displayed in a mess. So my question is when I insist on using -slideplot bar-, and the xaxis1 does not exist in the resulting plot, how can I modify the size or orientation of labels of the variable that used in the by-option. (Suppose that in this case I can't modify the value labels by shortening or abbreviating.) Thank you.

    Code:
    ssc install slideplot
    use http://www.stata-press.com/data/r8/voter.dta
    slideplot bar candidat [w=frac], neg(2) pos(3) by(inc)
    label define inc 1 "Less than 150000 US dollars" 2 "150000 to 300000 US dollars" 3 "300000 to 500000 US dollars" 4 "500000 to 750000 US dollars" 5 "More than 750000 US dollars"
    label values inc inc
    slideplot bar candidat [w=frac], neg(2) pos(3) by(inc)
    Click image for larger version

Name:	Graph.png
Views:	1
Size:	58.4 KB
ID:	1694957

    Last edited by Chen Samulsion; 26 Dec 2022, 06:26.

  • #2
    What kind of answer do you seek here? If you need shorter labels, define shorter labels. Genuinely mystified on what the question is unless it is about meeting an impossible optimum.
    Last edited by Nick Cox; 26 Dec 2022, 06:50.

    Comment

    Working...
    X