[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: RE: Add variable value on a graph

From   "Nick Cox" <>
To   <>
Subject   st: RE: RE: Add variable value on a graph
Date   Wed, 27 Aug 2008 14:58:14 +0100

The persuasion Martin suggests is unnecessary. You can add text to a
-line- graph using 
-text()-. Or you can put the same text in a title or the legend. 

Here is a dopey example. 

. sysuse auto

. sort weight mpg

. line weight mpg, text(3000 25 "some text")

If Alvine's problem were mine, I'd probably use -t1title()-. This is
best done as a loop, e.g. 

levelsof id, local(IDS)

foreach ID of local IDS { 
	su BMI if id == `ID', meanonly  
	line hem time, t1title(`r(min)') 


Martin Weiss

If you could be persuaded to use a -scatter- instead of -line-, then
scatter##marker_options- shows that you can add the value of a variable
your choice to the marker symbols...

I would like to create a graph with  repeated values of hemoglobin
time (0,1,2,6 and 12 months) for each subject of my data .

 gr twoway (line hem time) if id==1

I have a variable "BMI" in my data base which gives the BMI of each
I would like to add the value of BMI on each graph for each subject (as
legend) .
Is it possible to add on a plot the value of a variable ?

*   For searches and help try:

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