Hello,
I'm having problems in generating a combined graph with a single common legend, as it is the purpose of -grc1leg-. I've tried -grc1leg2- without identical results. I've also tried producing subgraphs with the -by(, legend(off))- option, but it gave me not legends anywhere.
In another post here, it seems like Nick Cox suggests -grc1leg- does not handle subgraphs with the -by()- option. Is that the case? Any way around this issue?
I'm using Stata/IC 14.2 on Windows 10. Please find my code below.
Code:
* Example generated by -dataex-. To install: ssc install dataex clear input double(order_0th order_1st order_2nd order_3rd) str3 Country float E_int .7713897514162157 .8983225631889338 .9502321908700299 .9751999295525718 "KOR" 1 .7728646528002182 .9383212578278355 .9819118726638241 .9942301335562106 "IRL" 1 .6520159877677851 .9121377064098004 .9747471517401809 .9917984486988558 "IRL" 0 .6120832068748473 .8152489201542453 .9045947423296314 .9509950438312654 "KOR" 1 .7631853372424123 .9394807242320112 .9829067108733993 .9945699072222791 "IRL" 1 .903293987668906 .9781866263244458 .9936282476232506 .9978061162704196 "IRL" 1 .865287920308868 .9622437133705122 .9871829259446699 .9952220573997735 "IRL" 0 .9999999999999248 .9999999999999863 .9999999999999963 .9999999999999989 "IRL" 1 .6792053150007263 .8063989295123989 .8937131164157297 .9441320938002318 "KOR" 1 .9197390025497783 .9779566782958434 .9927579596463956 .9973200689783972 "IRL" 1 .6365057955352291 .9023851889266424 .9734745091297393 .9922561223846332 "IRL" 1 .4225068227500901 .788998764115341 .9046037611433007 .9523722898556336 "KOR" 0 .9990615485362677 .9995811977144247 .9997887355023127 .9998918138706242 "KOR" 1 .9182802263367715 .9780545049436485 .9940366116334217 .998259042597569 "IRL" 1 .8725685337577995 .9672674068354333 .99025852065573 .9967693513075605 "IRL" 1 .9578451533226735 .9907174081433222 .9971845159005579 .9989958860915611 "IRL" 1 .8846973398371609 .9720648024371774 .9921325686225014 .9974391757004147 "IRL" 1 .7335101993068649 .8835785734219438 .9443981517357872 .9724995644900749 "KOR" 1 .8821281102440207 .9659512714005644 .988734623242631 .9959272584518145 "IRL" 1 .9466007799343315 .9868004469516986 .9957800546785351 .9984931323030795 "IRL" 1 end label values E_int E_int_label label def E_int_label 0 "Capital Intensive", modify label def E_int_label 1 "Labour Intensive", modify foreach v of varlist order_0th order_1st order_2nd order_3rd { label variable `v' "mean" statplot `v', over(E_int) by(Country, note("")) recast(bar) asyvars yla(, ang(h)) /// bar(2, bcolor(forest_green)) bar(1, bcolor(maroon)) /// ytitle(`v') xsize(15) ysize(8) /// by(, graphregion(fcolor(white) lcolor(white))) scheme(s2color) name(`v', replace) } * grc1leg2 order_0th order_1st order_2nd order_3rd
Veridiana
P.S.: I've benefitted from the Statalist Forum for years, but this is my first post. I hope I made it right, but please let me know if I can improve something. I'm really grateful to you all, especially to Nick Cox, who put some much time in giving us valuable tools and tricks.
Comment