Hello everybody,
I have a plot where I extend the margin around the plot region in order to display marker labels as a substitute for the legend.
When I do this, the plot title is still centered with respect to the plot region, but I would like to have it centered with respect to the entire graph region.
Any ideas how to do this?
Using the pos() options inside title() did not help.
Thanks!
Boris
Here is some example code:
I have a plot where I extend the margin around the plot region in order to display marker labels as a substitute for the legend.
When I do this, the plot title is still centered with respect to the plot region, but I would like to have it centered with respect to the entire graph region.
Any ideas how to do this?
Using the pos() options inside title() did not help.
Thanks!
Boris
Here is some example code:
Code:
clear input num time var 1 1 1 1 2 2 1 3 3 1 4 5 1 5 2 2 1 7 2 2 4 2 3 2 2 4 5 2 5 9 end gen name = "Louis George Maurice" if num==1 replace name = "Roseanne Marie Audile" if num==2 * Title centered wrt plot-region, not graph region: #delimit ; twoway (connect var time if num==1, col(navy)) (scatter var time if time==5 & num==1, msym(none) mlab(name) mlabcol(navy)) (connect var time if num==2, col(maroon)) (scatter var time if time==5 & num==2, msym(none) mlab(name) mlabcol(maroon)) , title("Not centered on graph region") graphregion(color(white) margin(3 30 1 3)) legend(off) name(take1,replace) ; #delimit cr
Comment