Announcement

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

  • Giving the same color to multiple variables in coefplot.

    Hello!
    I am trying to give my variables "likememe1" --> "likememe8" colors in my coefplot to identify the memes with the same political orientation. My problem is that there are two memes to each political orientation and i am unsure how to give the pairs the exact same color.
    The meme pairs are as followed:
    likememe1 likememe5
    likememe2 likememe6
    likememe3 likememe7
    likememe4 likememe8

    What color they get doesnt matter, i am just hoping someone can help.

    Code:
    coefplot likememe1 likememe2 likememe3 likememe4 likememe5 likememe6 likememe7 likememe8, ci(95) ///
        msymbol(oh) msize(small) ///
        drop(_cons 1.alder 2.alder 3.alder 4.alder 1.uddannelselængde 2.uddannelselængde 3.uddannelselængde 4.uddannelselængde 5.uddannelselængde 6.uddannelselængde 1.hvoroftelikerdumemes 2.hvoroftelikerdumemes 3.hvoroftelikerdumemes 4.hvoroftelikerdumemes 5.hvoroftelikerdumemes 6.hvoroftelikerdumemes) ///
        coeflabels(politiksvarmedekstrem_scaled = "Politisk orientering" _cons = "Constant") ///
        title("Hvem liker meme 1 til 8?") ///
        ylabel(, nogrid) xlabel(, noticks) ///
        legend(order(1 "Meme 1 & 5" 2 "Meme 2 & 6" 3 "Meme 3 & 7" 4 "Meme 4 & 8")) ///
        xline(0) ///

  • #2
    I recently did something similar using lines:

    Code:
    local pc1  "`plotline1' plot1(lc(red)) "
    local pc2  "`plotline2' plot2(lc(orange)) "
    local pc3  "`plotline3' plot3(lc(ebblue)) "
    local pc4  "`plotline4' plot4(lc(edkblue)) "
    local pc5  "`plotline5' plot5(lc(green)) "
    local pc6  "`plotline6' plot6(lc(mint)) "
    local pc7  "`plotline7' plot7(lc(yellow)) "
    xtline y, ov ytitle("Y") yline(1) xline(21975)    ///
        `pc1' `pc2' `pc3' `pc4' `pc5' `pc6' `pc7'                                    ///
        tlabel(, format(%tdCY) ) xtitle(Time)
    Might also read this that was just posted:

    HTML Code:
    https://medium.com/the-stata-gallery/getting-more-out-of-statas-graph-editor-a-concise-guide-b1149057307b

    Comment

    Working...
    X