Notice: On March 31, it was **announced** that Statalist is moving from an email list to a **forum**. The old list will shut down at the end of May, and its replacement, **statalist.org** is already up and running.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

From |
Nick Cox <njcoxstata@gmail.com> |

To |
statalist@hsphsun2.harvard.edu |

Subject |
Re: st: RE: -tabplot- and number of options limit |

Date |
Sun, 8 Jul 2012 18:57:15 +0100 |

What bites is not your -tabplot- syntax, or so I imagine, but what it implies. The way that -separate()- works is that a separate call to -twoway rbar- is set up for each distinct colour and each of those is associated with several options. Clearly I didn't try to see what the limit really was and my implication in the help that you can have up to 20 distinct colours is unduly optimistic. My guess is that what fails is the final call to -twoway-: in essence -tabplot- is just a busy helper setting up the stage before the drama is enacted by -twoway-, but the -twoway- syntax implied by -tabplot- can be too much for -twoway- to handle. Nick . On Sun, Jul 8, 2012 at 4:05 PM, Beede, David N <dbeede@doc.gov> wrote: > Yes, Nick, that was exactly it - originally I intended to give each industry > its own color and then abandoned that idea, but I forgot to drop the -separate()- > option. When I did drop -separate()-, -tabplot- worked for all 20 bars (now all with the same color). > Thank you for your insight into the problem. > > Still - notwithstanding the silliness of separate colors for each bar - I'm curious > about why -tabplot- ran up against the option limit, given that the "limitless option" option was > used in the ado file for -tabplot-. > > For what it's worth, here is the exact syntax that hit the limit: > > local i 1 > local barcolorlist "" > foreach mcolor in teal blue bluishgray brown cranberry cyan dkgreen dknavy /// > dkorange erose emerald forest_green gold gray green khaki lavender lime ltblue ltbluishgray { > local barcolorpiece " bar`i'(color(`mcolor'))" > local barcolorlist `barcolorlist'`barcolorpiece' > local ++i > } > tabplot speed`z'`x' categnew if 1 <= categnew & categnew <= 20 [iw=speedfreq], /// > xscale(alt) percent(categnew) separate(categnew) /// > showval yscale(reverse) /// > `barcolorlist' /// > subtitle("") /// > ytitle("") ylabel(, labsize(vsmall)) yscale(noline) /// > xtitle("") xlabel(, labsize(vsmall)) xscale(noline) /// > graphregion(color(white)) plotregion(color(white)) graphregion(icolor(white)) plotregion(icolor(white)) > > > Note that 1 <= categnew & categnew <= 13 works but 1 <= categnew & categnew <= 14 (and higher) hits the option limit. > > And I forgot to mention that -tabplot- is from SSC - sorry about that. > > Thanks, > David > From Nick Cox <njcoxstata@gmail.com> > To statalist@hsphsun2.harvard.edu > Subject Re: st: -tabplot- and number of options limit > Date Sun, 8 Jul 2012 02:06:56 +0100 > -------------------------------------------------------------------------------- > > Thanks very much for the commendation. > -tabplot- is from SSC. You don't cite the exact command you gave but > at a guess what is biting you is a limit on what you can do with > -twoway-. But my guess is that you are trying to use its -separate()- > option to get separate colours for each of your categories. That can > only lead to an extraordinary mess! The default with -tabplot- is that > categories are distinguished by axis labels and 20 categories on one > or both variables are no problem. -separate()- is intended only for > special cases, such as highlighting a subset. > I really need to see your exact syntax to advise well here. > Nick > On Sat, Jul 7, 2012 at 9:01 PM, Beede, David N <dbeede@doc.gov> wrote: >> I am trying to use -tabplot- with 20 industry categories (which also happens > to be the maximum permitted number of categories for the command according > to the help file), but I get an error message that I have too many options (the > default maximum number of options is 70 in Stata). On the Stata FAQs, I see > that one can get around the 70 option limit by using the * option in the -syntax- > command (as in syntax[, opt1 opt2...*]), and when I took a peek at the -tabplot- > ado file there indeed was a * at the end of syntax[]. So I am a bit puzzled why > I get the error message. Any thoughts? >> >> And I want to convey a heartfelt thank-you to Nick Cox for -tabplot- and everything else he has generously shared with us Statans. :) > * > * For searches and help try: > * http://www.stata.com/help.cgi?search > * http://www.stata.com/support/statalist/faq > * http://www.ats.ucla.edu/stat/stata/ * * For searches and help try: * http://www.stata.com/help.cgi?search * http://www.stata.com/support/statalist/faq * http://www.ats.ucla.edu/stat/stata/

**References**:**st: -tabplot- and number of options limit***From:*"Beede, David N" <dbeede@doc.gov>

**st: RE: -tabplot- and number of options limit***From:*"Beede, David N" <dbeede@doc.gov>

- Prev by Date:
**[no subject]** - Next by Date:
**st: contact email address** - Previous by thread:
**st: RE: -tabplot- and number of options limit** - Next by thread:
**st: RE: -tabplot- and number of options limit** - Index(es):