Announcement

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

  • 🐛 Suspect a bug in 15.1 is it still happening in Stata 16.0?

    Can anyone having Stata 16 already check if the following is occurring in it? Because in 15.1 the following code requires dropping one graph before plotting another, and I don't see any reason for that:

    Code:
    version 15.1
    clear all
    sysuse nlsw88
    
    graph hbar wage, over(union) over(occu) asyvar ///
       legend(pos(2) col(1) size(*.5)) ///
       name("legend")
       
     graph drop _all // strangely the code works only with this line enabled
       
    graph hbar wage, over(union) over(occu) asyvar ///
       legend(pos(2) col(1) size(*.5)) ///   
       bar(1, fc(orange)) bar(2, fc(green)) ///
       name("colors")
    If the highlighted line is commented out - the second graphing statement results in error 198:
    option(s) labelstyle( size(*.5)) not allowed

    Or is it, perhaps, something obvious that I've missed again?

    Thank you, Sergiy

  • #2
    The problem appears to be naming the first graph -legend-. If you changed it to -mylegend- it runs without issue. Why that problem would carry over to the second graph I am not sure, but if you simplify the second graph you get a return code of 4023:

    Code:
    . version 15.1
    
    . clear all
    
    . sysuse nlsw88
    (NLSW, 1988 extract)
    
    . 
    . graph hbar wage, over(union) over(occu) asyvar ///
    >    legend(pos(2) col(1) size(*.5)) ///
    >    name(legend, replace)
    
    .    
    . // graph drop _all // strangely the code works only with this line enabled
    . 
    . graph hbar wage
    rebuild: class member function not found
    r(4023);
    
    end of do-file

    Comment


    • #3
      Dear Scott,
      thank you for your advice.
      Changing the name to a different one has helped.
      Regards, Sergiy

      Comment

      Working...
      X