Dear Statalisters,
I want to adjust the line patterns and colors in my graph with the following code:
lpoly medPY010G PX020 if PB020=="DE", lpattern (dash) lcolor (black) noscatter addplot((lpoly medPY010G PX020 if PB020=="UK", lpattern (solid) lcolor (black)) (lpoly medPY010G PX020 if PB020=="NL", lpattern (dash_dot) lcolor (black)) (lpoly medPY010G PX020 if PB020=="IT", lpattern (shortdash) lcolor (black)) (lpoly medPY010G PX020 if PB020=="IE", lpattern (shortdash_dot) lcolor (black)) (lpoly medPY010G PX020 if PB020=="HU", lpattern (longdash_dot) lcolor (black))) title (test) legend(label(1 "DE") label(2 "UK") label (3 "UK") label (4 "NL") label(5 "IE") label (6 "HU"))
It works for all lines except the line for the first country "DE". I guess it is probably because I also specified noscatter? But even without that, that line does not change. I have tried various commands like:lpoly medPY010G PX020 if PB020=="DE", noscatter connect(l) lpattern (dash) lcolor (black)
Unfortunately, I cnanot find a code to change the pattern and color of that one line.
Does somebody has an idea how that could work?
Thanks in advance for any help!
Janina
I want to adjust the line patterns and colors in my graph with the following code:
lpoly medPY010G PX020 if PB020=="DE", lpattern (dash) lcolor (black) noscatter addplot((lpoly medPY010G PX020 if PB020=="UK", lpattern (solid) lcolor (black)) (lpoly medPY010G PX020 if PB020=="NL", lpattern (dash_dot) lcolor (black)) (lpoly medPY010G PX020 if PB020=="IT", lpattern (shortdash) lcolor (black)) (lpoly medPY010G PX020 if PB020=="IE", lpattern (shortdash_dot) lcolor (black)) (lpoly medPY010G PX020 if PB020=="HU", lpattern (longdash_dot) lcolor (black))) title (test) legend(label(1 "DE") label(2 "UK") label (3 "UK") label (4 "NL") label(5 "IE") label (6 "HU"))
It works for all lines except the line for the first country "DE". I guess it is probably because I also specified noscatter? But even without that, that line does not change. I have tried various commands like:lpoly medPY010G PX020 if PB020=="DE", noscatter connect(l) lpattern (dash) lcolor (black)
Unfortunately, I cnanot find a code to change the pattern and color of that one line.
Does somebody has an idea how that could work?
Thanks in advance for any help!
Janina
Comment