Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Portability of 'catplot' commands from new to old version

    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

  • #2
    On SSC at present catplot_old is the code for the original 2003 version. catplot2010is the code for the 2010 version. catplot is the code for the 2024 version. I am going to guess that you were using the 2010 version.

    To get all the key details, type


    Code:
    ssc desc catplot 
    1. If you don't want to use the newest version, don't install it.

    2. If you installed the newest version, but now regret that, you may have overwritten the previous catplot, but even if so, you can just delete the catplot files, rename catplot2010.ado and catplot2010.hlp to catplot.ado and catplot.sthlp and then whatever worked previously should still work.

    Comment


    • #3
      I think the following code will be helpful.

      Code:
      . which catplot
      c:\ado\plus\c\catplot.ado
      *! 3.0.1 NJC 19 October 2024 
      *! 3.0.0 NJC 23 September 2024 
      *! 2.0.2 NJC 10 December 2010 
      *! 1.0.0 NJC 18 February 2003
      
      . ado uninstall catplot
      
      . copy http://fmwww.bc.edu/RePEc/bocode/c/catplot2010.ado catplot.ado
      
      . copy http://fmwww.bc.edu/RePEc/bocode/c/catplot2010.hlp catplot.hlp

      Comment

      Working...
      X