Statalist


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

st: Scatter plot with marker labels: unexpected result


From   Friedrich Huebler <[email protected]>
To   [email protected]
Subject   st: Scatter plot with marker labels: unexpected result
Date   Fri, 6 Feb 2009 10:39:42 -0500

Scatter plots can have labels next to markers with the mlabel(varname)
option. If the variable used for the labels is numeric and contains
missing values, dots are drawn next to the markers. Is this behavior
documented and intended? I had expected that no labels would be drawn
for missing values.

. sysuse auto
. gen labels = mpg if mod(mpg,10) == 0
. scatter mpg weight, mlab(labels)

To avoid the dots for missing labels it is necessary to place the
labels in a string variable.

. gen labels2 = string(mpg) if mod(mpg,10) == 0
. scatter mpg weight, mlab(labels2)

Friedrich
*
*   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/



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