Announcement

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

  • Displaying ticks on axis while using burd scheme

    I am using burd scheme for charts. I like this scheme visual for everything, except that I would like to have tickmarks on axis. However even if I specify labels and tics, they do not appear on the chart. I imagine this scheme has removed the tickmarks from graphs. Is there a way I can override only that setting for the scheme and have my graphs display tickmarks? I have downloaded grstyle package and experimented with it, but unsuccessfully. Thank you!
    Last edited by Edith Lancaster; 02 Mar 2019, 20:51.

  • #2
    The files for this scheme are on SSC. (FAQ Advice #12.1: Please always explain where community-contributed commands -- or in this case files -- you refer to come from.)

    This worked for me:

    Code:
    . sysuse auto, clear
    (1978 Automobile Data)
    
    . scatter mpg weight, scheme(burd) xla(, tlc(black)) yla(, tlc(black))

    Comment


    • #3
      Thank you. It worked! Is there a way to have grid lines come on when needed as well? Burd also suppresses gridlines. I want to occasionally have dotted black gridlines where the tickmarks are at the axis.

      Comment


      • #4
        Just use the same method. Read the documentation and specify explicit options to undo the scheme default.

        Code:
        sysuse auto, clear
        scatter mpg weight, scheme(burd) xla(, tlc(black) grid glc(black) glp(dot)) yla(, tlc(black))

        Comment


        • #5
          The slightly tricky thing in this sort of case is that a scheme can take several strategies to suppress (e.g.) ticks, grids, and so on. One is to set the color to match the background or to "none" (or in Stata 15+ to be transparent); another is to set the line thickness to zero; another for ticks would be to set the length to zero; and the (probably best) is to turn them off, which is done differently for different elements.

          Which options will get them to appear depends on which approach as used to hide them, and so may require looking in the scheme file or experimenting.

          Comment


          • #6
            Nick (the other one) is right. My approximate order is to guess that (1) some feature has been switched off; (2) its colour has been set not to show; and (3) its length has been set to zero.

            Other way round, that is what I do when I suppress ticks, as I often want to do when the axis points are categories. (Suppressing ticks when the variable is measured I have to regard as perverse.)
            So

            Code:
            xla(, noticks)
            is the (kind of) option I try first, but in extreme cases it is necessary to fiddle with the colour or the length. I enjoy underlining that the tick is there, just hard to see when its colour is background or its length is zero.

            Comment


            • #7
              I am glad to see here discussion about Stata scheme, 'cause many posts have not yet received answers. In the original "scheme-burd.scheme" file, the author set color of tick and grid to none:
              Code:
              color major_grid none
              color tick none
              So, you should modify these setting in scheme-burd.scheme. The burd scheme suppress some default setting, you should modify something as well as add something. Be careful to make a copy of original scheme file before you modify.
              Code:
              color grid                      black  //make gridline visible
              color major_grid                black
              color minor_grid                black
              color tick                      black  //make ticks visible
              color minortick                 black
              axisstyle horizontal_default    horizontal_withgrid  //add grid of xlabel, i.e. (xlabel, grid)
              axisstyle vertical_default      vertical_nogrid  //suppress grid of ylabel
              linepattern major_grid          dot  //set linepattern of grid to dot
              linepattern minor_grid          dot

              Comment


              • #8
                Chen is right too. Looking at the scheme files and making your own variant is really the deepest strategy.

                Comment

                Working...
                X