Announcement

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

  • twoway - missing paranthesis & i can't spot it

    Hi i'm plotting this graph

    Code:
    twoway(line risk10y yearlymesh, sort clpat(solid solid) clwidth (medthick thin) clcolor (gs0 gs0)),  //till here the code is ok and it plots my graph
    
    //I have something wrong here
    ytitle(10 year probability(%), margin(medium)) ylabel(75(5)100, angle(horizontal) nogrid) xtitle(experience(no of robotics), margin(medium)) (150)250) legend(off) scheme(s2mono) graphregion(colour(white))
    Stata gives me the error: Option ( not allowed

    I have tried adding ) at ylabel - after the 100
    Stata gave me the error: angle(horizontal) is not a two-wayplot type

    I have tried adding another ) after % of y title
    Stata gave me the error: option ( not allowed

    Can you spot the error?



  • #2
    First, I assume that the // comments are not in the code you are trying to actually run. If they are, it is a problem, because to allow the command to continue on an additional line you need ///.

    That said, you have -(150)250)- in the midst of the second line. It appears to be stray material that was supposed to be part of a numlist. Whatever its original intent and purpose, it is sitting there, not part of any option, and, to make matters worse, its parentheses are not balanced. Was there supposed to be an -xlabel()- option that perhaps got incompletely removed?

    Comment


    • #3
      Yes, I had /// for my comments section
      I've tried the following

      Code:
      twoway(line risk10y yearlymesh, sort clpat(solid solid) clwidth (medthick thin) clcolor (gs0 gs0)), ///till here the code is ok and it plots my graph
      
      ///I have something wrong here
      
      ytitle(10 year probability(%), margin(medium)) ylabel(5(5)100), angle(horizontal) nogrid) xtitle(experience(no of robotics), margin(medium)) xlabel(1(2)60) legend(off) scheme(s2mono) graphregion(colour(white))
      error: angle(h) is not a two-way plot type

      I then tried removing the angle(h) part

      Code:
      twoway(line risk10y yearlymesh, sort clpat(solid solid) clwidth (medthick thin) clcolor (gs0 gs0)), ///till here the code is ok and it plots my graph
      
      ///I have something wrong here
      
      ytitle(10 year probability(%), margin(medium)) ylabel(5(5)100), xtitle(experience(no of robotics), margin(medium)) xlabel(1(2)60) legend(off) scheme(s2mono) graphregion(colour(white))
      Stata error:
      ) required

      Comment


      • #4
        The comma after ylabel(5(5)100) is not allowed.

        Comment

        Working...
        X