asjadnaqvi / stata-alluvial

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

add -offset- option #4

Closed mkaulisch closed 5 months ago

mkaulisch commented 1 year ago

Like in -streamplot- an offset-option would allow to use the label angel of 0 (zero). In -alluvial- this should affected both right and left side. Not sure if the -xsize- option already does this.

asjadnaqvi commented 1 year ago

added in v1.1

mkaulisch commented 1 year ago

Your implementation is one-sided to the right side. I would propose to center the offset and change row 690 into: local xrmin = r(min) - ((r(max) - r(min)) *offset' / 100)`

asjadnaqvi commented 1 year ago

I am not comfortable offsetting both sides at the same time given that the marker labels are likely to be oriented in one direction. One option is to add offmin() and offmax() options to have more control over which side is extended.

mkaulisch commented 1 year ago

that is okay with me as well. In my test it looks okay to have both sides affected. The need for an offset would also be reduced if -labpos- could be flexible for each variable like pos 3 for the first variable and pos 9 for the last variable.