Announcement

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

  • Graphics Schemes -- p#lineplot , for example

    Hi,
    I am trying to use graphics schemes after years of typing a lot of msymbol(Oh) mcolor(black) etc etc. on every twoway command...

    Anyway, I find the following problem.
    I have twoway lfit y x plots and twoway scatter y x plots on the same plot, ie.,

    twoway (scatter y x if s==1) (scatter y x if s==2) (lfit y x if s==1) (lfit y x if s==2)

    So, I put in my scheme:
    symbol p1 circle_hollow
    symbol p2 diamond_hollow
    symbol p3 triangle_hollow
    symbol p4 square_hollow

    color p1markline black
    color p2markline blue
    color p3markline red
    color p4markline green

    color p1lineplot black
    color p2lineplot blue
    color p3lineplot red
    color p4lineplot green

    I am trying to always get a hollow symbol and lfit line of the same color.
    But, instead I get
    plot 1 --> scatter plot that has Oh black (correct)
    plot 2 --> scatter plot that has Dh blue (correct)
    plot 3 --> lfit plot with a line that is red (WRONG)
    plot 4 --> lfit plot with a line that is green (WRONG)

    I say these are wrong because the scheme help file reads:
    Entry Description
    color p#lineplot colorstyle color for #th line plot

    and also,
    "For example, the entry color p3line yellow will make the third line plot yellow but will not affect the color of scatters, bars, or other plottypes"


    But it seems like the scheme is actually just changing the color of the #th plot, not specifically the color of #th lineplot.

    What am I missing? Is this an error in the documentation-- seems like that could be-- or why is graphics not keeping track of #th lineplot separately from #th plot?

    Or any suggestion for a way to set this up. I do this kind of thing a lot-- scatter with lfits by strata s -- and would like to have a consistent color combination for up to, say, 5 levels of s. It is tedious and creates enormous surplus code to always specific symbols and colors in each twoway command-- and is prone to errors. So I would love to use schemes or some other way to automate this.

    Scott

  • #2
    The Sandbox forum is for making test posts. From the description:
    Use this forum to make test posts, practice with the formatting features of the forum software, etc.
    Post in the General Forum.
    Steve Samuels
    Statistical Consulting
    [email protected]

    Stata 14.2

    Comment


    • #3
      Yes I did post it. Thanks. Was trying to insert graphs but to no avail.

      Comment


      • #4
        To answer your original post to some extent, you may want to look at <CODE>brewscheme</CODE> from SSC. I wrote it specifically to make things like this a bit easier and am in the process of building out some additional features before submitting an updated version to Kit/SSC. You can view examples from my <a href="http://www.stata.com/meeting/columbus15/abstracts/materials/columbus15_buchanan.pdf">Stata Conference 2015</a> presentation to see examples of what the program does in terms of setting the graph parameters in the scheme file.

        Comment


        • #5
          Scott Adams you may want to save yourself a bit of pain/suffering trying to do all of this manually. Check out the program brewscheme to do this a bit more easily. The project page is https://wbuchanan.github.io/brewscheme and you can find the most current set of features and functionality in the program's github repository: https://github.com/wbuchanan/brewscheme.

          Comment


          • #6
            Version 1.0 of brewscheme is now available from the SSC archives. The development version is still available from GitHub.

            Comment

            Working...
            X