Printing text on plot in a specific position Stata

Viewed 15

I am trying to print a text in the botton right of some plots. I know that I can use the coordinates to do that in the option text of a plot, but given that I have to plot around 50 charts that change a lot in terms of the axis magnitude, I´m looking if there is a way to do this by default.

clear all
set obs 100

gen x = runiformint(1, 100) 
gen y = runiformint(100, 200)   
egen z = seq(), f(1) t(100) 

    
scatter x z, text(1 100 "XXXX")
scatter y z, text(1 100 "XXXX")

In this code I can print the text in the first scatter but not in the second one.

1 Answers

Suppose you want to put text in the bottom right-hand corner of plot. Consider using a title option:

sysuse auto, clear 
scatter mpg weight, subtitle("frog", pos(5) ring(0))
scatter length weight, subtitle("toad", pos(5) ring(0))

See for discussion https://www.stata-journal.com/article.html?article=gr0051

Warning: Nothing rules out such a title obscuring point, line or area elements that represent data.

Related