Announcement

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

  • grstyle: new package for customizing graphs now available from SSC

    Thanks to Kit Baum, a new package called grstyle is now available from SSC. Type
    Code:
    . ssc install grstyle
    to install the package.

    grstyle allows you to customize the overall look of graphs from within a do-file without having to fiddle around with external scheme files. The advantage of grstyle over manually editing a scheme file is that everything needed to reproduce your graphs can be included in a single do-file.

    A short paper on grstyle is available from https://ideas.repec.org/p/bss/wpaper/29.html.

    Note that grstyle requires Stata to have writing rights in the PERSONAL ado-file directory. Type
    Code:
    . sysdir
    or
    Code:
    . personal
    to find out where the PERSONAL ado-file directory is.

    ben

  • #2
    That is really interesting! Thanks.
    Best regards,

    Marcos

    Comment


    • #3
      Ben Jann
      Aside from a slightly different syntax, what advantages do you see to your program vs brewscheme? If incorporating the aesthetics into the script is the only desired effect it seems like this would only be modifying a copy of s2color temporarily (?). If you have any experience working with dialog programming, maybe it would be better to combine efforts around building a user interface around brewscheme?

      Comment


      • #4
        wbuchanan
        brewsheme is much more powerful than grstyle. grstyle does nothing that could not be done by brewscheme, I believe. My goal was to have a very simple and straightforward tool to quickly modify the look of graphs on the fly. It is only meant for small changes (such as getting rid of background shading in s2color). Yes, think of it as temporarily modifying s2color (or whatever scheme is active when calling grstyle). Dialogs: no, I don't use dialogs and have no intention of getting into that.

        Comment


        • #5
          Ben Jann
          That was something that Michael Mitchell suggested as a way to make it easier for other users (as well as potentially creating some wrappers). Interesting that it will modify what ever the active scheme is though. Aside from coming up with an example to mimic the -ggplot2- aesthetics from R, I've not really done too much tweaking of many of those types of aesthetics (granted I did set the defaults to settings that I would typically apply anyway). I hadn't looked into the newest versions of the scheme files, but from your article it looks like the alpha level can be specified in the scheme as well; at some point I'll hopefully be able to spend sometime working on getting that added to things.

          Comment


          • #6
            wbuchanan
            alpha level: yes, that is possible. It is a bit tedious though, because you also have to specify the color and cannot just modify the opacity on its own (at least I didn't find out how).

            Comment


            • #7
              Ben Jann
              that doesn’t seem to be too bad. I’ll just need to parse the colors a bit to get the alpha level values separated from the colors.

              Comment


              • #8
                Hello,

                The following gives me an error message: 499: "grstyle not initialized". Is there something I am missing?

                net install grstyle, replace from(https://raw.githubusercontent.com/be...rstyle/master/)
                net install palettes, replace from(https://raw.githubusercontent.com/be...lettes/master/)
                net install colrspace, replace from(https://raw.githubusercontent.com/be...rspace/master/)

                grstyle set plain

                Comment


                • #9
                  Just as the command say
                  You need to initialize grstyle
                  "grstyle init"

                  Comment


                  • #10
                    I seize the occasion of this thread for a small query. What are the possible reasons behind an r(603) error ("could not be opened") after grstyle init newscheme ? The line comes almost at the very beginning of the do file. I write
                    Code:
                    clear all
                    capture log close
                    grstyle clear
                    grstyle init templots, replace
                    I don't have access rights problems and changing from the default Stata path to the more specific personal adopath doesn't solve the issue.
                    I'm using StataNow/MP 18.5

                    Comment


                    • #11
                      Don't know. Your example works fine for me. Maybe type

                      Code:
                      ssc install tr
                      tr: grstyle init templots, replace
                      to see where exactly the error occurs.

                      Comment


                      • #12
                        Thanks Ben Jann, I will try that. May I also bring to your attention this thread? Many thanks.
                        I'm using StataNow/MP 18.5

                        Comment

                        Working...
                        X