I am adding two limit lines with addplot to a plot from marginsplot using the following code:
I have tried to label the lines but they both appear labelled as y/yb in the key region rather than Lower and Upper. I can change these using the graphics editor but I would prefer to do it in the command line - if I could work out the syntax. The graphics editor shows the labels to be labels [8] and [9].
I am using Stata 14.
Martyn
Code:
marginsplot, title("Darkness, Black background") xlabel(100(100)1500) ytitle("{&Delta} E") /// plot1opts(lcolor(dkorange) mcolor(dkorange)) ci1opts(lcolor(dkorange)) /// plot2opts(lcolor(maroon) mcolor(maroon)) ci2opts(lcolor(maroon)) /// plot3opts(lcolor(gold) mcolor(gold)) ci3opts(lcolor(gold)) /// plot4opts(lcolor(gs9) mcolor(gs9)) ci4opts(lcolor(gs9)) /// plot5opts(lcolor(midgreen) mcolor(midgreen)) ci5opts(lcolor(midgreen)) /// plot6opts(lcolor(red) mcolor(red)) ci6opts(lcolor(red)) /// plot7opts(lcolor(dkgreen) mcolor(dkgreen)) ci7opts(lcolor(dkgreen)) /// addplot(pci 1 100 1 1500, lpattern(shortdash) lcolor(black) legend(label(8 "Lower"))|| pci 2 100 2 1500, lpattern(longdash) lcolor(black) legend(label(9 "Upper")))
I am using Stata 14.
Martyn
Comment