Dear all,
I wish to create a bar graph with 3 variables (inv_rate5 inv_rate10 inv_rate100), with a timeline in the 1903-1971 year range. I want to show year label every 5 years. I followed the suggestion provided by Cox (2021) to create a local to relabel the year values, but it does not seem to work in my case:
local call
forvalues j = 1903/1971 {
local show = `j'
if mod(`j', 5) local call `call' `j' "`show'"
else local call `call' `j' " "
}
graph bar inv_rate5 inv_rate10 inv_rate100, stack over(anno, relabel(`call') label(angle(45) labsize(tiny)))
References
Cox, N. J. (2021). Stata tip 140: Shorter or fewer category labels with graph bar. The Stata Journal, 21(1), 263–271. https://doi.org/10.1177/1536867X211000032
I wish to create a bar graph with 3 variables (inv_rate5 inv_rate10 inv_rate100), with a timeline in the 1903-1971 year range. I want to show year label every 5 years. I followed the suggestion provided by Cox (2021) to create a local to relabel the year values, but it does not seem to work in my case:
local call
forvalues j = 1903/1971 {
local show = `j'
if mod(`j', 5) local call `call' `j' "`show'"
else local call `call' `j' " "
}
graph bar inv_rate5 inv_rate10 inv_rate100, stack over(anno, relabel(`call') label(angle(45) labsize(tiny)))
References
Cox, N. J. (2021). Stata tip 140: Shorter or fewer category labels with graph bar. The Stata Journal, 21(1), 263–271. https://doi.org/10.1177/1536867X211000032
Comment