Hi all,
I want to edit a legend from a .gph file.
Say the gph file corresponds with the following command:
graph twoway (connected yvar1 xvar) || (rcap yvar_upper1 yvar_lower1 xvar) ///
twoway (connected yvar2 xvar) || (rcap yvar_upper2 yvar_lower2 xvar)


I want to add in a legend that corresponds with JUST yvar1 and yvar2.
0. using gr_edit, I want to do the following things.
1. add in a legend at the bottom
2. the legend will only have two keys, corresponding respectively with yvar1 and yvar2 (by default the legend will include yvar_upper1 yvar_lower1 yvar_upper2 yvar_lower2 as keys/labels 2, 3, 5, and 6 respectively. I just want keys/labels #1 and #4
3. the legend will be one row by two columns
4. the first key/label corresponds with the blue solid line (and has a solid blue line for the key) and the second key/label corresponds with the solid red (and has a solid red line for the key).
The only thing I've figured out so far is how to change the legend label text. e.g.:
gr_edit .legend.plotregion1.label[1].text = {"My label 1"}
I've also figured out to make the legend appear on gr_edit, but this currently displays all six keys/labels, but I can't figure out how to drop the unwanted keys (of course I can just replace the unwanted labels with empty text).
Would anyone know how to do this?
I want to edit a legend from a .gph file.
Say the gph file corresponds with the following command:
graph twoway (connected yvar1 xvar) || (rcap yvar_upper1 yvar_lower1 xvar) ///
twoway (connected yvar2 xvar) || (rcap yvar_upper2 yvar_lower2 xvar)
I want to add in a legend that corresponds with JUST yvar1 and yvar2.
0. using gr_edit, I want to do the following things.
1. add in a legend at the bottom
2. the legend will only have two keys, corresponding respectively with yvar1 and yvar2 (by default the legend will include yvar_upper1 yvar_lower1 yvar_upper2 yvar_lower2 as keys/labels 2, 3, 5, and 6 respectively. I just want keys/labels #1 and #4
3. the legend will be one row by two columns
4. the first key/label corresponds with the blue solid line (and has a solid blue line for the key) and the second key/label corresponds with the solid red (and has a solid red line for the key).
The only thing I've figured out so far is how to change the legend label text. e.g.:
gr_edit .legend.plotregion1.label[1].text = {"My label 1"}
I've also figured out to make the legend appear on gr_edit, but this currently displays all six keys/labels, but I can't figure out how to drop the unwanted keys (of course I can just replace the unwanted labels with empty text).
Would anyone know how to do this?
Comment