Announcement

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

  • choose specific color from color scheme

    Hi,

    I use the economist scheme for my line graphs. I have some line graphs with plenty of lines and some with only a few. How can I choose with plot/line is allocated a specific color from the scheme? I want to do this so that in all graphs, the same variables/countries have the same color, even though some graphs and more lines and others fewer.

    best,
    Chris

  • #2
    Use Ben Jann's palettes package:
    Code:
    net install gr0075, replace
    colorpalette economist

    Comment


    • #3
      Here is a very detailed guideline
      http://repec.sowi.unibe.ch/stata/pal...g-started.html

      Comment


      • #4
        I don't follow the question here. A scheme at most sets default colours, which you can always override by an explicit choice. Here is a simple example.

        Code:
        . webuse grunfeld
        
        . separate invest, by(company) veryshortlabel
        
        Variable      Storage   Display    Value
            name         type    format    label      Variable label
        -----------------------------------------------------------------------------------------
        invest1         float   %9.0g                 1
        invest2         float   %9.0g                 2
        invest3         float   %9.0g                 3
        invest4         float   %9.0g                 4
        invest5         float   %9.0g                 5
        invest6         float   %9.0g                 6
        invest7         float   %9.0g                 7
        invest8         float   %9.0g                 8
        invest9         float   %9.0g                 9
        invest10        float   %9.0g                 10
        
        
        . line invest1 invest2 year, lc(red blue) scheme(economist) ytitle(Investment)
        .

        Comment


        • #5
          I guess Christian wants to get name of colors that are used in economist scheme, then he can specify his desired colors in subsequent graph commands.
          Click image for larger version

Name:	7272f50a3311d83584a605a028eb3ded.png
Views:	1
Size:	11.0 KB
ID:	1698190

          Comment

          Working...
          X