asjadnaqvi / stata-alluvial

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

add option to manipulate xlabel size + color #9

Closed mkaulisch closed 5 months ago

mkaulisch commented 1 year ago

If I am not mistaken then size of xlabels (variable names) is not affected by labsize-option and the twoway-options are not passed to the graph.

It would be good to either harmonize xlable-size with size of category labels affected by labsize or to offer xlabelsize-option to specify this size.

ericmelse commented 1 year ago

Dear Asjad, I agree with this suggestion. Furthermore, if the 'flow steps' are indeed x-axis positions, then it should also be possible to use code to set the labels, like:

sysuse nlsw88.dta, clear
tw scatter hours grade , xlab(0 "no" 5 "five" 10 "ten" 15 "15" 20 "top" , labc(blue) labs(*1.3))

which results in: Alluvial_example_xlab_control_20230418 I assume to be able to get the same done in alluvial, like: Alluvial_test_1_20230418 we need something like:

sysuse nlsw88.dta, clear
label define racelbl 3 ".    O", modify
alluvial race married collgrad smsa union, palette(CET C7) labs(*1.4) showtot boxw(*16) shares vals(*1.2) valf(%12.2f) xlab(1 "Race" 2 "Married" 3 ""College" "graduate"" 4 ""Lives in" "SMSA"" 5 ""Union" "worker"" , labc(blue) labs(*1.3))

which would set the color and the size of x-axis labels as well as enable the visualization of (long) labels over two (or more) lines.