Good morning everyone,
I'm encountering a problem after not processing graphs with Stata for a while. Over time, I wrote some fairly standard commands to display stacked bar charts with grouping categories using 'catplot'. I now see—after reading some threads—that in the fall of 2024, the 'catplot' package was updated, changing its syntax. It seems to me, from a previous post, that it's possible to maintain the syntax of an older version of the catplot command (for example, catplot2010), but I don't seem to be able to execute it in Stata.
Operationally, I'd like to make a catplot loop that I wrote and used very frequently in the past work, like the following:
foreach var of varlist Q31_1-Q31_34 {
catplot_old `var', over(Q22) percent(Q22) legend(rows(1) stack ) legend(rows(1) stack ) bar(1, bcolor(196 68 56)) bar(2, bcolor(243 156 18 )) bar(3, bcolor(199 232 34)) bar(4, bcolor(15 208 36)) bar(5, bcolor(20 96 50)) var2opts(label(labsize(zero))) graphregion(color(white)) legend(label(1 "1") label(2 "2") label(3 "3") label(4 "4") label(5 "5") col(3) size(vsmall) region(style(none))) ytitle("") ysize(10) xsize(13) blabel(bar, position(center) format(%9.1f) size(tiny) color(white)) ylabel(,labsize(vsmall))
graph export "C:\Users\Folder\Graph_`var'_catplot.png", replace
}
Is there a way to maintain the syntax using an older catplot command, or do I necessarily have to rewrite the syntax with the new one?
Thank you,
Giorgio
I'm encountering a problem after not processing graphs with Stata for a while. Over time, I wrote some fairly standard commands to display stacked bar charts with grouping categories using 'catplot'. I now see—after reading some threads—that in the fall of 2024, the 'catplot' package was updated, changing its syntax. It seems to me, from a previous post, that it's possible to maintain the syntax of an older version of the catplot command (for example, catplot2010), but I don't seem to be able to execute it in Stata.
Operationally, I'd like to make a catplot loop that I wrote and used very frequently in the past work, like the following:
foreach var of varlist Q31_1-Q31_34 {
catplot_old `var', over(Q22) percent(Q22) legend(rows(1) stack ) legend(rows(1) stack ) bar(1, bcolor(196 68 56)) bar(2, bcolor(243 156 18 )) bar(3, bcolor(199 232 34)) bar(4, bcolor(15 208 36)) bar(5, bcolor(20 96 50)) var2opts(label(labsize(zero))) graphregion(color(white)) legend(label(1 "1") label(2 "2") label(3 "3") label(4 "4") label(5 "5") col(3) size(vsmall) region(style(none))) ytitle("") ysize(10) xsize(13) blabel(bar, position(center) format(%9.1f) size(tiny) color(white)) ylabel(,labsize(vsmall))
graph export "C:\Users\Folder\Graph_`var'_catplot.png", replace
}
Is there a way to maintain the syntax using an older catplot command, or do I necessarily have to rewrite the syntax with the new one?
Thank you,
Giorgio
Comment