Announcement

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

  • how to customize the symbol for the legend?

    I want to change the fifth symbol of the legend to "circle" and sixth symbol of the legend to "diamond", how to customize it?
    Thanks!
    Click image for larger version

Name:	2.png
Views:	1
Size:	53.4 KB
ID:	1621227

  • #2
    If I understand correctly,

    Code:
    legend(order(1 4 5 6 7 2 3))
    should do it.

    Comment


    • #3
      Originally posted by Andrew Musau View Post
      If I understand correctly,

      Code:
      legend(order(1 4 5 6 7 2 3))
      should do it.
      Thanks, Andrew! I didn't understand the logic here. Actually, the option of legend I used here is :
      Code:
      order(1 "90%置信区间" 2 "Cutoff - 2" 4 "Cutoff - 1" 6 "Cutoff" 8 "Cutoff + 1" 10 "Cutoff + 2"))
      How to modify this syntax work?
      Thanks again!

      Comment


      • #4
        Assuming that the symbols are already present in your graph and it's just a matter of ordering them, then based on your code in #3, you need

        Code:
        order(1 "90%置信区间" 6 "Cutoff" 8 "Cutoff + 1" 10 "Cutoff + 2"  2 "Cutoff - 2" 4 "Cutoff - 1"))

        Otherwise, provide a data example if my assumption is incorrect.

        Comment


        • #5
          Originally posted by Andrew Musau View Post
          Assuming that the symbols are already present in your graph and it's just a matter of ordering them, then based on your code in #3, you need

          Code:
          order(1 "90%置信区间" 6 "Cutoff" 8 "Cutoff + 1" 10 "Cutoff + 2" 2 "Cutoff - 2" 4 "Cutoff - 1"))

          Otherwise, provide a data example if my assumption is incorrect.
          Thanks Andrew, this cannot generate what I want.
          In the below example, I want to set the symbol of first regression to "O", the second regression to "Oh" in order for visual comparision. How to set the options for the legend?
          Code:
          sysuse auto,clear
           reg  price rep78 foreign length weight
          est store m1
           reg  price rep78 foreign length
          est store m2
          coefplot m1 m2 ,vertical drop(_cons)
          Last edited by Fred Lee; 30 Jul 2021, 01:20.

          Comment


          • #6
            coefplot is from SSC, as you are asked to explain (FAQ Advice #12).

            Code:
            coefplot (m1, label(Model 1) msy(O)) (m2, label(Model 2) msy(Oh)),vertical drop(_cons)

            Comment


            • #7
              Originally posted by Andrew Musau View Post
              coefplot is from SSC, as you are asked to explain (FAQ Advice #12).

              Code:
              coefplot (m1, label(Model 1) msy(O)) (m2, label(Model 2) msy(Oh)),vertical drop(_cons)
              Thanks so much!

              Comment

              Working...
              X