Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: legend of -graph pie-

From   [email protected] (Vince Wiggins, StataCorp)
To   [email protected]
Subject   Re: st: legend of -graph pie-
Date   Fri, 31 Oct 2003 10:37:16 -0600

UENOHARA Hideaki <[email protected]> notes that -graph pie- includes a
key in the legend for missing values when the -over()- and -by()- options are
combined and the over group variable has missing values

> After updating the executable and ado-files, I have found -graph
> pie- behaves peculiarly with respect to the legend.
> The problem is as follows:
> . sysuse auto.dta
> . graph pie, over(rep78) by(foreign)
> produces a pie chart whose legend has an extra key which corresponds
> to missing values. On the other hand
> . graph pie, over(rep78)
> does not.

Friedrich Huebler <[email protected]> notes that this behavior extends to
including keys for groups excluded with an -if- condition and also suggests
that we can use -legend(order(...))- to exclude any keys we wish.

This behavior is an unintended consequence of the fact that -by()- tries to be
completely generic and have no knowledge of the -graph- subcommand being
-by-ed, while at the same time allowing a common legend with a single set of
keys to be produced.  Suffice to say that we cannot get rid of those extra
keys without making -by()- smarter about which graph subcommand is being run.
That intelligence will be added in the next official update, either late this
afternoon or Monday.  Keys for unwanted missings and explicitly excluded
groups will no longer haunt our legends.

-- Vince
   [email protected]

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index