Q1. You should check out niceloglabels
from SSC as announced in this thread. niceloglabels
together with other tricks and devices in this territory will be discussed in a column expected to appear in Stata Journal 18(1) in the first quarter of 2018.
Value labels are limited to association with integers but that does not bite here. All you need focus on is the text which is to be displayed as axis labels at designated points on either axis; such points can be specified using any numeric value within the axis range.
Your specific problem appears to be that one of your variables is a natural logarithm but you wish to label axes in terms of powers of 10. Conversion to a variable containing logarithms to base 10 is surely easy, but another program mylabels
(SSC) can help here. This is a self-contained example.
* ssc inst mylabels
sysuse auto, clear
set scheme s1color
gen lnprice = ln(price)
mylabels 4000 8000 16000, myscale(ln(@)) local(yla)
gen lnweight = ln(weight)
mylabels 2 3 4, myscale(ln(1000*@)) suffix(" x 10{sup:3}") local(xla)
scatter lnprice lnweight, yla(`yla') xla(`xla') ms(Oh) ytitle(Price (USD)) xtitle(Weight (lb))

I have used different styles for the two axes just to show what is possible. On other grounds it is usually preferable to be consistent about style.
Broadly speaking, the use of niceloglabels
is often simpler as it boils down to specifying xscale(log)
or yscale(log)
with the labels you want to see. niceloglabels
also looks at a variable range or a specified minimum and maximum to suggest what labels might be used.
Q2. range()
is an option with twoway function
that allows extension of the x axis range. For most graph commands, the pertinent options are xscale()
or yscale()
, which again extend axis ranges if suitably specified. None of these options will omit data as a side-effect or reduce axis ranges as compared with what axis label options imply. If you want to omit data you need to use if
or in
or clone your variables and replace values you don't want to show with missing values in the clone.
FWIW, superscripts look much better to me than ^
for powers.