Announcement

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

  • stmono2 scheme

    Schemes stmono1 and stmono2 have been optimized for printing on monochrome printers. Also,
    rather than using the same symbol over and over and varying the color, stmono1 and stmono2
    will vary the symbol’s shape, and in connecting points, stmono1 and stmono2 vary the line pattern
    (stcolor varies the color).
    I'm using the stmono2 scheme and the line pattern is not varying as the above quote from the manual suggests. The line pattern does vary as expected in stmono1. I'm using StataNow 18.5. Any thoughts on what's happening?

    Toy example to reproduce:
    Code:
    sysuse auto
    
    set scheme stmono2
    
    regress price mpg##foreign
    margins mpg##foreign
    marginsplot

  • #2
    Interesting. Sure looks like a bug to me.

    stmono1 is based on the earlier s1mono, and stmono2 is based on the earlier s2mono. Those exhibit the same patterns.

    Comparing scheme-s1mono.scheme and scheme-s2mono.scheme, we see the issue.

    scheme-s1mono.scheme specifies:
    Code:
    linepattern p1line  solid
    linepattern p2line  dash
    linepattern p3line  vshortdash
    and so forth.

    However, scheme-s2mono.scheme specifies:
    Code:
    linepattern p1lineplot  solid
    linepattern p2lineplot  dash
    linepattern p3lineplot  vshortdash
    and so forth.

    As far as I can tell, p#lineplot isn't doing anything, only p#line makes a difference. This is despite -help scheme line plots- explaining p#lineplot but not p#line.

    I'm curious what the difference between p#line and p#lineplot is supposed to be.

    As a workaround, you can use Ben Jann's grstyle like this:
    Code:
    sysuse auto
    
    set scheme stmono2
    grstyle init
    grstyle linepattern p1line  solid
    grstyle linepattern p2line  dash
    grstyle linepattern p3line  vshortdash
    grstyle linepattern p4line  longdash_dot
    grstyle linepattern p5line  longdash
    grstyle linepattern p6line  dash_dot
    grstyle linepattern p7line  dot
    grstyle linepattern p8line  shortdash_dot
    grstyle linepattern p9line  tight_dot
    grstyle linepattern p10line dash_dot_dot
    grstyle linepattern p11line longdash_shortdash
    grstyle linepattern p12line dash_3dot
    grstyle linepattern p13line longdash_dot_dot
    grstyle linepattern p14line shortdash_dot_dot
    grstyle linepattern p15line longdash_3dot
    
    regress price mpg##foreign
    margins mpg##foreign
    marginsplot
    
    grstyle clear

    Comment


    • #3
      Interesting! That adds another layer of inconsistency then with the p#line vs p#lineplot issue. Is there somewhere formal I should submit a potential bug report?

      Comment


      • #4
        I already emailed Stata Tech Support to notify them, mentioning this thread. I'll post here if they respond. (Or maybe they will themselves.)

        Comment


        • #5
          Thanks!

          Comment


          • #6
            p#line is for connected plots, as -help scheme connected plots- explains. p#lineplot is for line plots, as -help scheme line plots- explains.
            Code:
            webuse sp500, clear
            keep in 1/15
            
            // Fails (solid linepattern)
            tw line open high low close date, scheme(stmono1)
            
            // Succeeds (varied linepatterns)
            tw line open high low close date, scheme(stmono2)
            
            // Succeeds (varied linepatterns)
            tw connected open high low close date, scheme(stmono1)
            
            // Fails (solid linepattern)
            tw connected open high low close date, scheme(stmono2)
            I don't see why s1mono/stmono1 and s2mono/stmono2 should differ in this respect, and I personally think it was an oversight.

            Stata Technical Support's response was:
            I'll forward it to developers to see if the behavior is intentional or not. Not sure any changes would be made to the current schemes, though.

            Comment


            • #7
              Interesting. Thanks for the update!

              Comment

              Working...
              X