Announcement

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

  • Oneway plot colors and value callout

    Hi everyone,

    I am trying to create a simple oneway plot with distribution of values for different indicators. I used the following code below but all the marker colors are green. Is it possible to have different colors for different indicators and is it possible to have a callout for "national average" with larger msize and bolder mcolor? National average is indicated in another variable named "state"

    onewayplot value, by(indicator) vertical mcolor(green olive red blue orange)

  • #2
    onewayplot is a program from SSC -- last revised in 2004! -- as you are asked to explain (FAQ Advice #12),

    So far as it is concerned you have only one variable, so only the first marker color is relevant. The others are ignored. Using by() makes no difference to that.

    Since 28 November 2005 it has been superseded by stripplot (also SSC). I can't use your data, as you don't give an example (also FAQ Advice #12), but some technique is shown here.

    Code:
    sysuse auto
    
    stripplot mpg, vertical over(foreign) separate(foreign) bar  stack scheme(s1color) height(0.2) ms(Sh Oh) legend(off) boffset(-0.1) yla(, ang(h))
    Using separate colours seems superfluous if you have segregation into groups, but separate() will do it for you. There are various ways to show means; using a separate variable is not the best.

    Comment

    Working...
    X