asjadnaqvi / stata-alluvial

A Stata package for alluvial plots
MIT License
5 stars 3 forks source link

Alluvial readabillity - add new passthru options #17

Closed ericmelse closed 5 months ago

ericmelse commented 1 year ago

Dear Asjad, For me, readabillity is as important as the use of color in any plot. Therefore, I always try to organize titles and labels horizontally when that is doable. So, again working on my example, making good use of the not yet documented option valgap(str) :

use "MBO22Keuzedelen_Start_20230413.dta" , clear
gen c_keuzedl=1
replace c_keuzedl=2 if KEUZEDEELKEUZE==3
replace c_keuzedl=3 if KEUZEDEELKEUZE==2
replace c_keuzedl=4 if KEUZEDEELKEUZE==4
label define lbl_c_keuzedl 1 "Oriënteren" 2 "Samenwerken" 3 "Analyseren'" 4 "Reflecteren" , replace
label values c_keuzedl lbl_c_keuzedl
label var c_roc "College"
label var vrouw "Studenten"
label var c_keuzedl "Keuzedeel"
alluvial c_roc vrouw c_keuzedl , laba(0) labs(*1.4) showtot boxw(*80) shares vals(*1.2) valf(%12.2f) valgap(*18) palette(carto) name(roc2, replace)

which results in: Alluvial_test_3_20230418 Now, I have broad levels so that the categorical labels and their values (shares) can be read more easy. But, not yet at the leftmost and rightmost level. My inclination now is to add a twoway option to increase the graphregion margin left and right because not only the labels are 'chopped' but also the (now more broad) levels, like adding the code: graphreg(m(l+10 r+10)) but alluvial disagrees with me doing that:

option graphreg() not allowed
r(198);

I also tried plotreg(m(l+10 r+10)) but with the same result. I suppose that it will not be that complicated to add the regular graphregion and plotregion parameter controls (or would the use of the scheme white_tableau prohibit that?).

Best, Eric