[R] plotting question

Gavin Simpson gavin.simpson at ucl.ac.uk
Tue Oct 31 23:37:57 CET 2006


On Tue, 2006-10-31 at 16:52 -0500, Leeds, Mark (IED) wrote:
> i have the axis line of code  below in a plotting command and it works
> nicely  but it puts tick values at every 5 of lt and i would like a tick
> value at every value of lt. i read about pretty() but that sounded
> tricky so instead , since i want a tick mark at every value of lt ( it's
> discrete and goes from o to some max value usually arounsd 35 or 40 )
>  
> i changed the line to  at = seq(1,max(lt) ) but that gave me no
> tickmarks ?

?unique

> lt <- sample(1:40, 50, replace = TRUE) # dummy data
> lt
 [1] 37 30 38 33 13 19  6 39 15 21  5 11  5  5 32  1 23 20 12 21 35 32
34 26 39
[26] 30 11 36 26 12 37 27 26  9 23  2 24  4 20  3  1  7 27 37 31 25 38
29 29 17
> plot(lt, type = "l")
> axis(4, at = unique(lt))

Looks a bit weird because of the number of unique values in lt, but will
look OK with the data series you posted earlier.

Also, 

> plot(lt, type = "l")
> axis(4, at = pretty(range(lt)),line=0.75,tick=TRUE)

doesn't look right on my default device, do you really want to move the
axis away from the plot margin?

HTH

G

>  
> any help is appreciated. thanks.
>  
> #-----------------------------------------------------------------------
> --------
>  
> axis(4, at = pretty(range(lt)),line=0.75,tick=TRUE)
>  
> #-----------------------------------------------------------------------
> ------
> --------------------------------------------------------
> 
> This is not an offer (or solicitation of an offer) to buy/sell the securities/instruments mentioned or an official confirmation.  Morgan Stanley may deal as principal in or own or act as market maker for securities/instruments mentioned or may advise the issuers.  This is not research and is not from MS Research but it may refer to a research analyst/research report.  Unless indicated, these views are the author's and may differ from those of Morgan Stanley research or others in the Firm.  We do not represent this is accurate or complete and we may not update this.  Past performance is not indicative of future returns.  For additional information, research reports and important disclosures, contact me or see https://secure.ms.com/servlet/cls.  You should not use e-mail to request, authorize or effect the purchase or sale of any security or instrument, to send transfer instructions, or to effect any other transactions.  We cannot guarantee that any such requests received via !
>  e-mail will be processed in a timely manner.  This communication is solely for the addressee(s) and may contain confidential information.  We do not waive confidentiality by mistransmission.  Contact me if you do not wish to receive these communications.  In the UK, this communication is directed in the UK to those persons who are market counterparties or intermediate customers (as defined in the UK Financial Services Authority's rules).
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch 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.
-- 
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%
 Gavin Simpson                 [t] +44 (0)20 7679 0522
 ECRC & ENSIS, UCL Geography,  [f] +44 (0)20 7679 0565
 Pearson Building,             [e] gavin.simpsonATNOSPAMucl.ac.uk
 Gower Street, London          [w] http://www.ucl.ac.uk/~ucfagls/cv/
 London, UK. WC1E 6BT.         [w] http://www.ucl.ac.uk/~ucfagls/
%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%~%



More information about the R-help mailing list