Announcement

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

  • Formatting outliers in graph box: Change of color & size only manually for every outlier?

    I have a graph box with two independent variables. One independent variable is organized as separate variables (years) and labeled using different colors from blue to red, one is the "over"-variable on the x-axis (here the vertical axis, because I'm using a "hbox").

    This is what it looks like so far:
    Click image for larger version

Name:	graph1.png
Views:	2
Size:	53.7 KB
ID:	1379652

    I would want the "outliers" to have the same color as the variable they belong to (for example, the boxe s for year 1 are blue, however, the outliers of year-1-data are shown in a completely different color - for example, orange or green).

    My easy question is: Is there any way to automatically format the outliers in the same color as the boxes (or do I have to do that manually for every single outlier on every graph)?

    My second question is: Is there a way to format the size for all outliers in the graph at once (without doing it manually for every single outlier on every graph), maybe using a change in the scheme or (ideally) using simply an option?


    Thank you for your help.
    Attached Files
    Last edited by Guest; 22 Mar 2017, 12:16.

  • #2
    Please post your code and your graph as .png. http://www.statalist.org/forums/help#stata explains.

    Comment


    • #3
      Thank you Nick, I've included the PNG graph.
      Code is:

      graph hbox H1a1 H1a3 H1a5 H1a7 H1a9 H1a10 if H1a1 < 200, over( δ ) legend(rows(1)) box(1, color(blue*1.6)) box(2, color(blue*1)) box(3, color(blue*0.4)) box(4, color(red*0.7)) box(5, color(red*1.3)) box(6, color(red*1.6)) yvaroptions(relabel(1 "1 Jahr" 2 "3 Jahre" 3 "5 Jahre" 4 "7 Jahre" 5 "9 Jahre" 6 "10 Jahre")) ysize(3)

      The question here is quite general and an answer does not need data (however tell me if it does help): Is there any way to automatically format the outliers in the same color as the boxes?
      Last edited by Guest; 22 Mar 2017, 12:29.

      Comment


      • #4
        66 box plots???!!!

        Is this an answer, needing extension in your case?

        Code:
        . sysuse auto
        (1978 Automobile Data)
        
        . graph box price, over(foreign) box(1, bcolor(pink)) marker(1, mcolor(pink))

        Comment


        • #5
          The name tag here "Guest" implies that the original poster has removed himself from Statalist.

          Comment


          • #6
            Is there a way to format all outliers in one command, without needing to 'number' them?

            Comment

            Working...
            X