[R] number format in plots

Jarek Jasiewicz jarekj at amu.edu.pl
Fri Oct 10 20:02:42 CEST 2008


Thanks, really it is difficult to find solution
Jarek

Peter Dalgaard pisze:
> Jarek Jasiewicz wrote:
>> Hi
>> It is probably simple but how to force in plot command number format:
>> 20000, 30000, 40000 etc. instead of 2e+04, 3e+04 etc.
>>
> Not all that simple! It's one of those cases where you need to regain 
> some control that you normally leave to the automatics.  What you can 
> do is to use one of format(), formatC(), sprintf(),  to get the 
> values  into the format you want, xaxt="n" to get rid of the default x 
> axis and then axis(1, at=value, labels=fvalue).
>
>> example of command:
>>
>> plot(x=data$along, y=data$rzedna,type="l", xlim=c(0,max(data$along)), 
>> ylim=c(200,1200), main="", xlab="length", ylab="height", cex.main=2, 
>> cex.lab=1.5, cex.axis=1.2, lwd=2)
>>
>> thanks
>> Jarek
>>
>> ______________________________________________
>> R-help w 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