Announcement

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

  • Change legend symbols independent of graph symbols

    Dear community,

    Do you have an idea how to change the symbols that are used in the legend?

    For example: I have a line chart but square symbols should be shown in the legend.

    Thank you in advance!

    Best regards from Zurich,
    Markus

  • #2
    Hello Markus,

    Welcome to the Stata Forum.

    I guess it did not understand your query, for, IMHO, no matter whether we change the symbol, legend symbols must go on a par with the symbols inside the graphic.

    Perhaps you could clarify by presenting a brief display of the data as well as the graph, as recommended in the FAQ.

    Best,

    Marcos
    Best regards,

    Marcos

    Comment


    • #3
      Hi Marcos

      Thank you for your reply.

      "legend symbols must go on a par with the symbols inside the graphic" that's exactly what I am trying to change. If this is not possible in Stata, I need to use another programme (e.g. Adobe Illustrator) to change it there.

      Or do you see any work-around within Stata?

      Best,
      Markus

      Comment


      • #4
        Like Marcos, I am puzzled why you want to do this, but it's possible. You just create an extra variable that is not actually shown on the graph. This may start you off.

        Code:
        webuse grunfeld
        line invest year if company == 1
        gen frog = .
        line invest year if company == 1 || scatter frog year, ms(Sh) legend(order(2 "invest"))

        Comment


        • #5
          Thank you, Nick!

          I did not think of this work-around.

          The reason is simply aesthetics.

          Best,
          Markus

          Comment


          • #6
            Still puzzled.

            Comment

            Working...
            X