[R] Label axis tick marks with a simple function of axis value

MacQueen, Don macqueen1 at llnl.gov
Mon Apr 7 18:30:41 CEST 2014


If you want to customize tick mark labels, use the axis() function.

Something along the lines of

plot(x,y, xaxt='n')
xat <- pretty(x)
axis(1, at=xat, labels=1/xat)

-Don

-- 
Don MacQueen

Lawrence Livermore National Laboratory
7000 East Ave., L-627
Livermore, CA 94550
925-423-1062





On 3/31/14 3:25 PM, "Hurr" <hill0093 at umn.edu> wrote:

>How can I label existing axis tick marks with a
>simple function of axis value like 1/AxisValue?
>It seems like this should be an operation where
>I just use the formula.
>
>
>
>
>--
>View this message in context:
>http://r.789695.n4.nabble.com/Label-axis-tick-marks-with-a-simple-function
>-of-axis-value-tp4687917.html
>Sent from the R help mailing list archive at Nabble.com.
>
>______________________________________________
>R-help at r-project.org mailing list
>https://stat.ethz.ch/mailman/listinfo/r-help
>PLEASE do read the posting guide
>http://www.R-project.org/posting-guide.html
>and provide commented, minimal, self-contained, reproducible code.




More information about the R-help mailing list