[R] How do I show real values on a log10 histogram
John Kane
jrkrideau at inbox.com
Tue Mar 26 13:11:38 CET 2013
Hi Shane.
I don't know. I am not clear on what you are asking. I would think that it would but can you supply some stripped-down code for people to have a look at?
See https://github.com/hadley/devtools/wiki/Reproducibility and/or
http://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example for some suggestions on how to do this.
Oh and please don't reply in html. The R-help list strips html and while everything came through fine here, it can really jumble code if when the html is removed.
BTW you only replied to me. It is a lot better to reply to the group especially as a lot of R-help people are a lot more knowledgeable than I am and you often can get faster responses. I have included the R-help list in this response.
John Kane
Kingston ON Canada
-----Original Message-----
From: careyshan at gmail.com
Sent: Tue, 26 Mar 2013 11:35:50 +0000
To: jrkrideau at inbox.com
Subject: Re: [R] How do I show real values on a log10 histogram
Hi John,
I have four plots in a matrix format and Im already using par, if I use your code below the graph will not export as one of the four in the matrix, is there a way of overcoming this?
Thanks for your help.
Cheers
On Tue, Mar 26, 2013 at 10:48 AM, John Kane <jrkrideau at inbox.com> wrote:
Something like this? It does an extra y-axis but the principle is the same for an x-axis
# Create the data to be graphed
x<-1:10
y1<-x
y2<-x^2
# Set the par values
op <- par(las=1,xaxs="r",mai=c(1,0.75,1,1))
# Draw first plot
plot(x,y1,xlim=c(0,10),ylim=c(0,10), ylab="y1", las = 1)
title(main="Multiple Y-Axes in R")
# Draw second plot
par(new=TRUE)
plot(x,y2,xlim=c(0,10),xaxt="n",yaxt="n",ylab="",pch=16)
axis(4,at=c(0,20,40,60,80,100))
text(12, 50, "y2", srt = 270, xpd = TRUE)
par(op) # reset par
John Kane
Kingston ON Canada
> -----Original Message-----
> From: careyshan at gmail.com
> Sent: Tue, 26 Mar 2013 10:19:09 +0000
> To: r-help at r-project.org
> Subject: [R] How do I show real values on a log10 histogram
>
> Hi,
>
> I have a histogram with values logged to the base 10
>
> hist(log10(x),breaks=60)
>
> How do I show the log values on the x-axis and a second x-axis showing
> the
> real values?
>
> Thanks
>
> --
> Shane
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help [https://stat.ethz.ch/mailman/listinfo/r-help]
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html [http://www.R-project.org/posting-guide.html]
> and provide commented, minimal, self-contained, reproducible code.
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys [http://www.inbox.com/smileys]
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
--
Shane
____________________________________________________________
GET FREE SMILEYS FOR YOUR IM & EMAIL - Learn more at http://www.inbox.com/smileys
Works with AIM®, MSN® Messenger, Yahoo!® Messenger, ICQ®, Google Talk™ and most webmails
More information about the R-help
mailing list