Announcement

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

  • twoway and tsline

    hi,

    I am using below code to plot two different variables with different scales on a same plot but I want to change lines' colors. I used some different options but they didn't work. any idea?

    main code: twoway (tsline rev ,yaxis(1)) (tsline price ,yaxis(2)) if code_marque==3

    below didnt work:

    . twoway (tsline rev ,yaxis(1)) (tsline price,yaxis(2)) if code_marque==3, lc(green blue)
    option lc() not allowed

    . twoway (tsline rev ,yaxis(1)) (tsline price,yaxis(2), lc(green)) if code_marque==3
    variable green not found

    . twoway (tsline rev ,yaxis(1)) (tsline price ,yaxis(2), mcolor(green)) if code_marque==3
    variable green not found




  • #2
    A certain abandon in the use of commas appears to be the problem. e.g.

    Code:
    webuse grunfeld, clear
    
    twoway (tsline invest if company ==1 ,yaxis(1) lc(blue)) (tsline kstock if company == 1,yaxis(2) lc(green))

    Comment

    Working...
    X