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

st: How to suppress legend keys

From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: How to suppress legend keys
Date   Wed, 9 Apr 2003 10:43:00 -0700 (PDT)

How can I suppress legend keys for variables without data? Let me
illustrate this with a meaningless example from the auto data.

. sysuse auto
. scatter headroom rep78 mpg

The scatterplot has a legend with two keys, "Headroom (in.)" and
"Repair Record 1978". Now I replace all values for headroom with
missing values and draw the scatterplot again.

. replace headroom=.
. scatter headroom rep78 mpg

The legend still has two keys although only the repair record appears
in the graph.

Is it possible to instruct Stata to only show keys for data that
appears in the graph? I am thinking of something like "show legend
for headroom if headroom is not missing and show legend for rep78 if
rep78 is not missing".

Thank you,

Friedrich Huebler

Do you Yahoo!?
Yahoo! Tax Center - File online, calculators, forms, and more
*   For searches and help try:

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