Announcement

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

  • what is the code for this scheme?

    hi I have stata 17.0 , I'm using -set scheme white_jet-

    but I get 2 dark blue lines, how to I change the colour to a red colour for females

    Click image for larger version

Name:	Screenshot 2025-07-03 at 15.53.36.png
Views:	1
Size:	807.8 KB
ID:	1779480

    Code:
    ologit osteoperosis i.sex i.age_cat
    margins age_cat, over(sex) predict(outcome(3))
    marginsplot, ///
        recast(line) ///
        xdimension(age_cat) ///
        ytitle("Predicted Probability") ///
        title("Risk of Osteoporosis by Age Category and Sex") ///
        xlabel(, angle(45))
    or perhaps it may be easier to change it to the scheme stata help uses , here's a screen shot of the graph on stata help, do you know what the code is for this scheme:


    Click image for larger version

Name:	Screenshot 2025-07-03 at 15.52.20.png
Views:	1
Size:	123.2 KB
ID:	1779479

  • #2
    The graph you cited is plotted using stcolor scheme that was introduced in Stata 18. You can certainly reproduced its colors under white_jet scheme.
    Code:
    set scheme white_jet
    webuse nhanes2, clear
    logistic highbp sex##agegrp##c.bmi
    margins sex, at(bmi=(10(5)65))
    marginsplot, name(jet1, replace)
    marginsplot, recast(line) xdimension(bmi) ytitle("Predicted Probability") plot1opt(color("26 133 255")) plot2opt(color("212 17 89")) ci1opt(color("26 133 255")) ci2opt(color("212 17 89")) name(jet2, replace)
    Click image for larger version

Name:	jet1.png
Views:	1
Size:	215.9 KB
ID:	1779492



    Click image for larger version

Name:	jet2.png
Views:	1
Size:	215.0 KB
ID:	1779493

    Comment


    • #3
      FYI, Nick Cox had documented the colours used in the stcolor scheme on this thread.

      Comment

      Working...
      X