Skip to content

Adding x-axis values to a histogram

3 messages · diegol, Henrique Dallazuanna, Peter Alspach

#
Dear useRs,

Is there a way one can add x-axis values to a histogram? Example:

z = rgamma(n=1000, shape = 8, scale = 1000)
hist(z, breaks = 30)

Currently I see 4 x-axis values: 5000, 10000, 15000, 20000. Can I add more
values or modify the ones currently showing? I tried ?hist, yet couldn't
work this out.

Thank you very much.

-----
~~~~~~~~~~~~~~~~~~~~~~~~~~
Diego Mazzeo
Actuarial Science Student
Facultad de Ciencias Econ?micas
Universidad de Buenos Aires
Buenos Aires, Argentina
#
Try this:

hv <- hist(z, breaks = 30, xaxt='n')
axis(1, hv$breaks )
On 11/03/2008, diegol <diegol81 at gmail.com> wrote:

  
    
#
Diego

?axis

e.g.:

hist(rnorm(100))
axis(1, -3:2+0.5, rep('',6), tck=-0.01)

HTH ....

Peter Alspach
983513p15983513.html
The contents of this e-mail are privileged and/or confidential to the named
 recipient and are not to be used by any other person and/or organisation.
 If you have received this e-mail in error, please notify the sender and delete
 all material pertaining to this e-mail.