Announcement

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

  • putting the legend to the bottom layer

    Click image for larger version

Name:	1.png
Views:	1
Size:	87.8 KB
ID:	1498870

    How to do that?
    Last edited by Fred Lee; 18 May 2019, 02:02.

  • #2
    and how to change the size of legend?

    Comment


    • #3
      you don't show (as requested by the FAQ) your actual command so
      Code:
      help legend_options
      there are lots of options so read carefully

      Comment


      • #4
        These are some options for your to choose (from the Stata Manual):

        position(clockposstyle), ring(ringposstyle), and bplacement(compassdirstyle) override the default location of the legend, which is usually centered below the plot region. position() specifies a direction [sic] according to the hours on the dial of a 12-hour clock, and ring() specifies the distance from the plot region.
        Best regards,

        Marcos

        Comment


        • #5
          Originally posted by Fred Lee View Post
          and how to change the size of legend?
          Code:
          * Example generated by -dataex-. To install: ssc install dataex
          clear
          input byte cashDividend01 double ChairCEO byte totalTMT
          1 0 9
          1 0 10
          1 0 10
          1 0 11
          1 0 10
          1 0 10
          1 0 11
          1 0 5
          1 0 5
          0 0 5
          0 0 2
          0 1 5
          0 0 5
          0 0 6
          0 0 4
          0 0 4
          0 1 2
          0 1 3
          0 0 4
          0 0 4
          0 0 5
          0 0 5
          0 0 6
          0 0 5
          0 0 5
          0 0 5
          0 0 5
          1 0 7
          1 0 7
          1 0 8
          1 0 8
          1 0 8
          1 0 10
          1 0 9
          1 0 7
          1 0 6
          0 0 4
          0 0 4
          0 0 5
          0 0 5
          0 0 6
          0 0 5
          0 0 3
          0 0 3
          0 0 4
          0 0 6
          0 0 5
          0 0 4
          0 0 4
          0 0 4
          0 0 4
          0 0 4
          0 0 5
          0 0 7
          0 1 10
          1 1 10
          1 1 7
          1 1 7
          0 1 7
          1 1 9
          1 1 9
          1 1 9
          1 1 9
          0 1 3
          0 1 3
          0 0 2
          0 0 6
          0 0 5
          0 0 5
          0 0 6
          0 0 7
          1 0 8
          0 0 9
          0 0 8
          0 0 8
          0 0 8
          1 0 8
          1 0 7
          1 0 6
          1 1 6
          1 1 7
          1 1 7
          1 1 7
          1 1 7
          1 1 7
          1 0 7
          1 0 5
          1 0 7
          1 0 6
          1 0 6
          1 0 5
          1 0 5
          1 0 6
          1 0 6
          1 0 6
          1 0 6
          0 0 1
          1 0 9
          1 0 9
          1 0 7
          end
          logit cashDividend01 i.ChairCEO##c.totalTMT
          margins ChairCEO,at( totalTMT =(1(1)11))
          marginsplot,noci legend(ring(0) pos(2))
          Here is the code, could you please help me?

          Comment


          • #6
            Originally posted by Marcos Almeida View Post
            These are some options for your to choose (from the Stata Manual):
            I have read this tips but have no solutions, can you give me an example using the code above?

            Comment


            • #7
              I think the legend will always be on the top layer. But why not just remove the background fill of the legend box? This can be done in several ways:
              Code:
              marginsplot, noci legend(ring(0) pos(2) region(style(none)))
              marginsplot, noci legend(ring(0) pos(2) region(fcolor(none)))
              marginsplot, noci legend(ring(0) pos(2) region(style(outline)))
              ben

              Comment


              • #8
                Originally posted by Ben Jann View Post
                I think the legend will always be on the top layer. But why not just remove the background fill of the legend box? This can be done in several ways:
                Code:
                marginsplot, noci legend(ring(0) pos(2) region(style(none)))
                marginsplot, noci legend(ring(0) pos(2) region(fcolor(none)))
                marginsplot, noci legend(ring(0) pos(2) region(style(outline)))
                ben
                Thanks a lot!

                Comment

                Working...
                X