Announcement

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

  • bihist (SSC) label options

    Hi all,

    I am attempting to change axis labels in a plot using bihist (SSC):

    Code:
    sysuse auto, clear
    
    bihist dis, by(foreign) tw1(color(blue)) tw(color(red) legend(size(med) order(2 1) ring(0) pos(12))) // A
    
    bihist dis, by(foreign) tw1(color(blue)) tw(color(red) legend(size(med) order(2 1) ring(0) pos(12)) ylabel(0(5)20)) // B
    
    bihist dis, by(foreign) tw1(color(blue) ylabel(0(5)20)) tw(color(red) legend(size(med) order(2 1) ring(0) pos(12))) // C
    Specifically, I want to get the axis labels in option 'B' in both half-plots; in my real data I am getting ugly decimal labels in each half-plot. FWIW, there's a (slightly cryptic) note in the help file :

    "tw(twoway_options) passes options to twoway_bar. Note that options passed by default may be superseded in this way, for example y axis labels, but some added options may be ignored as a result of existing options (e.g. yscale will not override the range specified by the existing y axis labels)."

    Any ideas to pass options correctly to -tw- ?

    cheers-

    Andrew Lover
    Last edited by Andrew Lover; 21 Apr 2015, 00:55.
    __________________________________________________ __
    Assistant Professor, Department of Biostatistics and Epidemiology
    School of Public Health and Health Sciences
    University of Massachusetts- Amherst

  • #2
    I tried this, but the program just undoes the explicit text for each axis label. It gets you a little closer.
    Code:
    bihist dis, by(foreign) tw1(color(blue)) tw(color(red) legend(size(med) order(2 1) ring(0) pos(12)) ylabel(-20 "20" -15 "15" -10 "10" -5 "5" 0(5)20)) name(B, replace)



    Last edited by Nick Cox; 21 Apr 2015, 03:41.

    Comment


    • #3
      Thanks for the hint, Nick- I'll post code when/if I get something....

      cheers!
      __________________________________________________ __
      Assistant Professor, Department of Biostatistics and Epidemiology
      School of Public Health and Health Sciences
      University of Massachusetts- Amherst

      Comment


      • #4
        Not the question, but on the whole I don't find these back-to-back or base-to-base designs especially attractive or helpful.
        One of many alternatives (naturally, this isn't your real data any more than it is mine, but we will stick with the example):
        Code:
          sysuse auto, clear
          
        * next command only if you haven't installed it
          ssc inst stripplot  
        
        stripplot displacement, over(foreign) height(0.5) width(10) stack ms(Sh) yla(, noticks)
        Click image for larger version

Name:	stripplot..png
Views:	1
Size:	11.6 KB
ID:	1291774







        Comment

        Working...
        X