Announcement

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

  • Box plot - line styles

    Hi,

    Is there a way to quickly define an outline style for all boxes present in the box plot chart? Inseatad of typying box(1, lwidth(thin)) and repeating that on a number of occasions I would like for the line style to automatically apply to all boxes present.
    Kind regards,
    Konrad
    Version: Stata/IC 13.1

  • #2
    Hi Konrad,

    I'd think you'll find that if you simply enter the option once, it will apply to all the box plots. At least i have just used your bolded text in my recent graphs with 60 box plot to this effect and had similar experience using marker(1,msize(vsmall)) in the same manner. this is using stata 13.1 MP

    Cheers
    Rob

    Comment


    • #3
      My understanding is that box(#, options) corresponds to specific box plot. The line of code that initially provided changes outline width only in the first box plot.
      Kind regards,
      Konrad
      Version: Stata/IC 13.1

      Comment


      • #4
        I think the difference is the number of variables being shown, not how many separate box plots there are given an over() option, a by() option, or both.

        Comment


        • #5
          I produced the box plot using the code below.
          Code:
          graph box varlist, ///
              over(ifincraigwish, sort(1) descending label(labsize(vsmall))) ///
              nooutsides alsize(40) ///
              lines(lwidth(thin) lpattern(solid)) ///
              box(1, lwidth(medthin)) ///
              box(2, lwidth(medthin)) ///
              box(3, lwidth(medthin)) ///
              ytitle("Population", size(small)) ///
              ylabel(, labsize(vsmall)) ///
              b1title("Geography", size(small)) ///
              plotregion(lstyle(none)) ///
              title("Vars", size(medium)) ///
              subtitle("{it: IGZ level, 2011}", size(small)) ///
              note("Outliers are excluded.",size(vsmall)) ///
              caption("{it: Data Source: Scottish Neighbourhood Statistics}", size(vsmall)) ///
              legend(rows(3) cols(1) ring(0) size(vsmall) position(1) rowgap(.5) ///
              region(fcolor(ltbluishgray)) symxsize(10)) ///
              lines(lwidth(vthin)) ///
              name(boxplotpopulations, replace)
          Kind regards,
          Konrad
          Version: Stata/IC 13.1

          Comment

          Working...
          X