The second y-axis in ggplot2 is only intended to relabel an axis with a
fixed transformation. E.g. one axis in degree Celcius and one in Kelvin,
km and miles, ...
It does not rescale the variables.
It looks like you want to display two variables with unrelated units on the
same y-axis. That is
Thank you Rui and Thierry for the suggestion, it helped me.
thanks
On Fri, Jan 8, 2021 at 6:58 AM Rui Barradas wrote:
> Hello,
>
> What about the following?
> First get the min and max of value by variable == "y1".
> Then use that range to scale up "y2".
>
> rng <- tapply(daT1$value,
Hello,
What about the following?
First get the min and max of value by variable == "y1".
Then use that range to scale up "y2".
rng <- tapply(daT1$value, daT1$variable, range)$y1
ggplot(data = daT1, aes(x = x, group = variable, color = variable)) +
geom_line(data = subset(daT1, variable ==
Hi R users,
I was trying to plot a graph with a secondary axis, and used the following
code for the data but the secondary line and secondary y -axis value did
not match. I would like to show both lines in one graph.
Any suggestions?
library(ggplot2)
library(reshape2)
daT<-structure(list(x =
Thank you very much, Jim. You help a lot!
On Thu, Nov 7, 2019 at 2:09 PM Jim Lemon wrote:
> That's not too hard:
>
> x11(width=7,height=5)
> par(cex.axis=.8)
> fin_month<-month
> fin_month[fin_month>6]<-fin_month[fin_month>6]-12
> fin_month<-fin_month+6
>
That's not too hard:
x11(width=7,height=5)
par(cex.axis=.8)
fin_month<-month
fin_month[fin_month>6]<-fin_month[fin_month>6]-12
fin_month<-fin_month+6
plot(fin_month~year,axes=FALSE,type="l", ylab="Month", xlab="Year",
main="Month of occurrence in year")
axis(1,at=seq(1981,2014,3))
Dear Jim,
Thank you very much for nice suggestion and figure there. But what I need
is the y axis start from let say 7 (July) and end at 6 (June).
In those sense, I can said clearly that the occurrence, minima in this
case, is fall during winter season, because Jan and Dec close to each other.
Hi Ani,
There are a number of ways to modify this sort of plot. Here is one:
x11(width=7,height=5)
par(cex.axis=.8)
plot(month~year,xaxt="n", type="l", ylab="Month", xlab="Year",
main="Month of occurrence in year")
axis(1,at=seq(1981,2014,3))
library(plotrix)
Dear R-Help,
I have 35 data that is month when the annual minima happened. So I want to
plot those data but the order of y axis is not from 1 to 12, but let say
start from 9,10,11,12,1,..8. The reason to do this is when 12 (Dec) meet 1
(Jan) in the following year the graph is not quite good (for
For David Winsemius.
As always, You help out! Immensely grateful!
__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide
On 9/4/19 7:35 AM, Medic wrote:
The Y scale is divided (by default) as:
0.0 ... 0.2 ... 0.4 ... 0.6 ... 0.8 ...1.0
But I would like so:
0 ... 20 ... 40 ... 60 ... 80... 100
(with rotating axis labels)
When I use par function (marked as comment here) it turns out
correctly for ONLY ONE
The Y scale is divided (by default) as:
0.0 ... 0.2 ... 0.4 ... 0.6 ... 0.8 ...1.0
But I would like so:
0 ... 20 ... 40 ... 60 ... 80... 100
(with rotating axis labels)
When I use par function (marked as comment here) it turns out
correctly for ONLY ONE picture?! Help me, please. (This is the code
Thanks, Eric! It works well.
2017-10-12 9:13 GMT-07:00 Eric Berger :
> Hi John,
> You can try the following:
>
> override.linetype=c("twodash","solid")
> p <- ggplot(obs, aes(x = Timestamp))
> p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype
>
Hi John,
You can try the following:
override.linetype=c("twodash","solid")
p <- ggplot(obs, aes(x = Timestamp))
p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype
="Temperature"))
p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity",
linetype="Humidity"))
p <- p +
Sorry let me clarify.
If I modify the line
p <- p + geom_line(aes(y = air_temp, colour = "Temperature"))
by
p <- p + geom_line(aes(y = air_temp, colour = "Temperature", linetype
="Temperature"))
and
p <- p + geom_line(aes(y = rel_hum/5, colour = "Humidity"))
by
p <- p + geom_line(aes(y =
Hi,
To my knowledge, an excellent of ggplot with a second y-axis is
https://rpubs.com/MarkusLoew/226759
In this example, the author uses two colors for the two lines, but the
line shapes are the same -- both are solid. Could each line have its own
color as well as its own shape? For
Hi Pedro,
Try this:
par(mar=c(5,5,4,2))
plot(seq(0,9000,1000),yaxt="n",ylab="")
axis(2,seq(1000,9000,1000),
labels=formatC(seq(1000,9000,1000),format="f",
big.mark=",",digits=2),las=2)
Jim
On Sun, Jun 4, 2017 at 7:11 PM, Pedro páramo wrote:
> Hi all,
>
> I have been
Hi all,
I have been looking on documentation but I´m not able to find how to
customize format on y axis so that for example:
y value goes from 1000 to 9000 it appears on thousand position a 1,000 and
on the comas with "," and two decimals.
(For the previous answers many thanks)
Hello all
I am trying to plot histogram with break in y-axis for my data by
following various posts on R- help but none seems solving my problem. My
data looks like:
hdata
$breaks
[1] 0 5 10 15 20 25 30 35 40 45 50
$counts
[1] 16311 10824 8 1 3 0 1 6 3
on
Thank you for the reply. Can I have a gap starting from 50 instead of 120
so that the values with lower frequency can show up more predominantly?
Hi reviverma,
I think your problem is that you have chosen the wrong gap, as it cuts
out all of the small bars. Try this:
Hi reviverma,
I think your problem is that you have chosen the wrong gap, as it cuts
out all of the small bars. Try this:
gap.barplot(hdata$counts, gap=c(120,15900), xlab=RMSD,
ytics=c(0,100,16000,16100,16200,16300),ylab=Frequency,
xtics=hdata$breaks)
Note that you have one more breaks than
Thanks Dennis.
df.melted$value-as.numeric(df.melted$value)
df.melted$value - format(df.melted$value, scientific = FALSE)
Mohan
On Sun, Sep 14, 2014 at 9:22 AM, Dennis Murphy djmu...@gmail.com wrote:
Hi:
Try
str(df.melted)
I'm guessing value is a factor. It needs to be numeric or
On Sep 14, 2014, at 1:15 AM, Mohan Radhakrishnan wrote:
Thanks Dennis.
df.melted$value-as.numeric(df.melted$value)
See the FAQ about converting factors to numeric.
The more typical way of making that conversion is:
df.melted$value-as.numeric(as.character(df.melted$value))
... although
options(scipen=100, digits=4)
df.melted$value-as.integer(df.melted$value)
I was not looking at the return type of 'format'. But these alternative
work well.
Thanks,
Mohan
On Sun, Sep 14, 2014 at 9:57 PM, David Winsemius dwinsem...@comcast.net
wrote:
On Sep 14, 2014, at 1:15 AM, Mohan
I have more control over labels using David's suggestion.
scale_y_continuous(breaks=seq(min(df.melted$value)-2,max(df.melted$value),by=170)
Thanks,
Mohan
On Mon, Sep 15, 2014 at 10:14 AM, Mohan Radhakrishnan
radhakrishnan.mo...@gmail.com wrote:
options(scipen=100, digits=4)
Hi,
This is the code to create a ggplot. The plot is rendered but the y-axis
labels are not continuous. So the lines are split.
Moreover multiple y-axis labels overwrite each other due to this. How can I
fix this?
If I try to set ylim I get
*Discrete value supplied to continuous scale*
Hi Everyone,
I have a frequency data, which I am displaying with an area-curve-like
plot in ggplot2 using:
ggplot(dfs, aes(x=values)) + geom_density(aes(group=ind))
The Y-axis that is returned is density, which is not really intuitive
for my purposes and I would like to change it for
-Original Message-
I'm a bit of a rooky in R and do not know how to change the
y-axis intervals of a boxplot.
...
I used the following code for producing this boxplot:
boxplot((fitted(finalfit4) *100) ~
instabilitydata2$MRI_Diag_Instab_rev, ylim=c(0,100),
xlab=MRA diagnosis,
Dear R-users,
I'm a bit of a rooky in R and do not know how to change the y-axis intervals of
a boxplot.
The y-axis in my boxplot ranges from 0 to 100 which is fine. The problem is the
interval level in between. Now it increases with steps of 20 but I'd like to
have it changed by steps of 5.
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope this help,
Pascal
On 29/03/13 16:37, Berg, Tobias van den wrote:
Dear R-users,
I'm a bit of a rooky in R and do not know how to change the y-axis intervals of
a boxplot.
The y-axis in my boxplot ranges
den
CC: 'r-help@r-project.org'
Onderwerp: Re: [R] changing y-axis intervals in a boxplot
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope this help,
Pascal
On 29/03/13 16:37, Berg, Tobias van den wrote:
Dear R-users,
I'm a bit of a rooky in R and do
: Berg, Tobias van den
CC: 'r-help@r-project.org'
Onderwerp: Re: [R] changing y-axis intervals in a boxplot
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope this help,
Pascal
On 29/03/13 16:37, Berg, Tobias van den wrote:
Dear R-users,
I'm a bit of a rooky
] changing y-axis intervals in a boxplot
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope this help,
Pascal
On 29/03/13 16:37, Berg, Tobias van den wrote:
Dear R-users,
I'm a bit of a rooky in R and do not know how to change the y-axis
intervals of a boxplot
, at=70)
axis(side=2, at=90)
Kind regards,
Tobias
-Oorspronkelijk bericht-
Van: Pascal Oettli [mailto:kri...@ymail.com]
Verzonden: vrijdag 29 maart 2013 8:44
Aan: Berg, Tobias van den
CC: 'r-help@r-project.org'
Onderwerp: Re: [R] changing y-axis intervals in a boxplot
Hello,
?par
29 maart 2013 8:44
Aan: Berg, Tobias van den
CC: 'r-help@r-project.org'
Onderwerp: Re: [R] changing y-axis intervals in a boxplot
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope this help,
Pascal
On 29/03/13 16:37, Berg, Tobias van den wrote:
Dear R-users
-
Van: Pascal Oettli [mailto:kri...@ymail.com]
Verzonden: vrijdag 29 maart 2013 8:44
Aan: Berg, Tobias van den
CC: 'r-help@r-project.org'
Onderwerp: Re: [R] changing y-axis intervals in a boxplot
Hello,
?par (particularly the 'yaxt' argument)
?axis ('side' and 'at' arguments)
Hope
AM
Cc: 'r-help@r-project.org'
Subject: Re: [R] changing y-axis intervals in a boxplot
Every week, I learn something new with R-help.
Pascal
On 29/03/13 20:23, Jim Lemon wrote:
And if you would like to be able to read the crowded axis:
boxplot(count ~ spray, data = InsectSprays, col
How you can change the Y-axis intervals in a graph?
Use and ylim command but this command only changes the minimum and maximum
values of the axis, I want to do is take the axis values from 10 to 10
for example
How I can do?
thanks
--
View this message in context:
?axis
On Wed, Nov 21, 2012 at 12:44 PM, Elli ellilti_...@hotmail.com wrote:
How you can change the Y-axis intervals in a graph?
Use and ylim command but this command only changes the minimum and maximum
values of the axis, I want to do is take the axis values from 10 to 10
for example
How
On Nov 21, 2012, at 9:44 AM, Elli wrote:
How you can change the Y-axis intervals in a graph?
Use and ylim command but this command only changes the minimum and
maximum
values of the axis, I want to do is take the axis values
from 10 to 10
for example
How I can do?
?axis
You will
thank you!
--
View this message in context:
http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649718.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
On 11/13/2012 06:59 AM, Geophagus wrote:
thanks, that works fine! good idea.
I have one last question regarding this problem.
My y-scale now is grouped from 0 - 4000 in 1000.
Is it possible to set the scale into not equal breaks like
5,10,100,1000,5000 ?
My axis now:
Hi Jim and thanks for your answer.
It does not work how I want. When I use your proposal, the values are
superimposed like shown on the pic.
pic.png http://r.789695.n4.nabble.com/file/n4649368/pic.png
Thats my code (what I need is a y-scale with the following interrupts:
5,10,100,1000,5000):
On 11/13/2012 11:01 PM, Geophagus wrote:
Hi Jim and thanks for your answer.
It does not work how I want. When I use your proposal, the values are
superimposed like shown on the pic.
pic.pnghttp://r.789695.n4.nabble.com/file/n4649368/pic.png
Thats my code (what I need is a y-scale with the
HI @ all,
I'm looking for a simple solution to supress the y-axis - but only the drawn
scale - not the values.
Only the numbers should be displayed.
I tried yaxt=n but there everything of the y-axis is supressed.
Thanks
GeO
--
View this message in context:
Hello,
Like this?
plot(1:10, yaxt = n)
axis(2, at = 1:10, labels = 1:10, tick = FALSE)
Hope this helps,
Rui Barradas
Em 12-11-2012 10:08, Geophagus escreveu:
HI @ all,
I'm looking for a simple solution to supress the y-axis - but only the drawn
scale - not the values.
Only the numbers
Hi and thanks for your answer,
I need no axis - only the labels.
In your example 1 to 10.
Greetz
GeO
--
View this message in context:
http://r.789695.n4.nabble.com/no-drawn-y-axis-but-values-tp4649298p4649324.html
Sent from the R help mailing list archive at Nabble.com.
Hello,
If you want to completely remove the axis, overplot in color white.
plot(1:10, yaxt = n)
axis(2, at = 1:10, labels = 1:10, tick = FALSE)
axis(2, at = 1:10, labels = 1:10, col = white)
Hope this helps,
Rui Barradas
Em 12-11-2012 17:18, Geophagus escreveu:
Hi and thanks for your answer,
Or perhaps something this:
plot(1:10, axes = FALSE, ann = FALSE)
axis(2, at = 1:10, tick = FALSE, lty = blank)
and if you want the x axis:
axis(1, at = 1:10)
Not clear if you want the frame around the plot region or not. If so, there are
some options using ?box and see ?par, specifically,
HI,
May be this helps:
par(bty=n)
plot(1:10,yaxt=n)
axis(2, at = 1:10, labels = 1:10, tick = FALSE)
A.K.
- Original Message -
From: Geophagus f...@retposto.net
To: r-help@r-project.org
Cc:
Sent: Monday, November 12, 2012 12:18 PM
Subject: Re: [R] no y-axis
Hi and thanks for your
thanks, that works fine! good idea.
I have one last question regarding this problem.
My y-scale now is grouped from 0 - 4000 in 1000.
Is it possible to set the scale into not equal breaks like
5,10,100,1000,5000 ?
My axis now:
axis(2,at=seq(0,4000,1000),col = white, las=1)
thanks a lot
GeO
...@gmail.com]
Sent: Tuesday, November 06, 2012 11:11 AM
To: r-help@r-project.org
Subject: [R] Survplot, Y-axis in percent
Hi
I am a new fan of R after getting mad with the graphical functional in SPSS.
I have been able to create a nice looking Kaplan Meyer graph using Survplot
function.
However I
06, 2012 11:11 AM
To:
r-help@
Subject: [R] Survplot, Y-axis in percent
Hi
I am a new fan of R after getting mad with the graphical functional in
SPSS.
I have been able to create a nice looking Kaplan Meyer graph using
Survplot function.
However I have difficulties in turning the y
Dear Prof Harell, great thanks for your solution to this. I have been trying
to figure this out last four weeks by reading loads of manuals and forums
around the net without success.
Once again thank you for the solution and the great option of shadowed Conf
int in the survplot
Best Regards
Hi
I am a new fan of R after getting mad with the graphical functional in SPSS.
I have been able to create a nice looking Kaplan Meyer graph using Survplot
function.
However I have difficulties in turning the y axis to percent instead of the
default 0-1 scale.
Further I have tried the function
On Nov 6, 2012, at 8:10 AM, maziar.mohaddes wrote:
Hi
I am a new fan of R after getting mad with the graphical functional in SPSS.
I have been able to create a nice looking Kaplan Meyer graph using Survplot
function.
However I have difficulties in turning the y axis to percent instead
As far as I can see, survplot.survfit (from package rms) is written with
base graphics, so you need to suppress the
default axis call with yaxt=FALSE, and replace it with your desired
values using axis(2, at=..., labels=...).
Thanks alot for your response. Unfortunately yaxt function does
On Nov 6, 2012, at 12:18 PM, maziar.mohaddes wrote:
As far as I can see, survplot.survfit (from package rms) is written with
base graphics, so you need to suppress the
default axis call with yaxt=FALSE, and replace it with your desired
values using axis(2, at=..., labels=...).
Thanks alot
On Nov 6, 2012, at 1:39 PM, maziar.mohaddes wrote:
Thanks alot for ur help. Sorry about me be being a real rookie in forum
manners.
I am pretty new to R and although i did read the forum rules before
submitting obvoiusly I was not able to
I did try the yaxt=n, as stated in my post.
I
:
Sent: Friday, July 20, 2012 3:29 PM
Subject: [R] Control y axis
I can't get the y axis to extend the full range that I need, which is -8 to 8
Here's my code. I tried using ylim, but it's still truncating at the
extremes in my data.
plot(x, y, type =o, xlab=Panelist, ylab=T value,lwd=1.5,lty=1)
xlim
Sent: Friday, July 20, 2012 11:42 PM
Subject: Re: [R] Control y axis
Thanks! Do you know how I could get the values -8:8 to print on the y axis?
On Fri, Jul 20, 2012 at 9:06 PM, arun smartpink...@yahoo.com wrote:
Hi,
The bracket after lty=1 should be replaced with comma (,).
x-1:15
y--8:6
))
A.K.
From: Stefanie Wind wind.stefa...@gmail.com
To: arun smartpink...@yahoo.com
Sent: Saturday, July 21, 2012 9:48 AM
Subject: Re: [R] Control y axis
Nevermind - got it this way:
plot(x, y, type =o, xlab=Panelist, ylab=T value, lwd=1.5, xlim=c(1,14
-Original Message-
From: r-help-boun...@r-project.org [mailto:r-help-bounces@r-
project.org] On Behalf Of arun
Sent: Saturday, July 21, 2012 2:16 PM
To: Stefanie Wind
Cc: R help
Subject: Re: [R] Control y axis
Hi,
No problem.
I was gettting -8 and 6 for the code I sent to you. I am using R
I can't get the y axis to extend the full range that I need, which is -8 to 8
Here's my code. I tried using ylim, but it's still truncating at the
extremes in my data.
plot(x, y, type =o, xlab=Panelist, ylab=T value,lwd=1.5,lty=1)
xlim=range(1:14),ylim=range(-8:8), las=1)
Any suggestions?
it is a typo
you sent
plot(x, y, type =o, xlab=Panelist, ylab=T value,lwd=1.5,lty=1)
xlim=range(1:14),ylim=range(-8:8), las=1)
it should have been
plot(x, y, type =o, xlab=Panelist, ylab=T value,lwd=1.5,lty=1,
xlim=range(1:14),ylim=range(-8:8), las=1)
On Fri, Jul 20, 2012 at 3:29 PM,
-project.org [mailto:r-help-boun...@r-project.org] Namens
Ben quant
Verzonden: woensdag 14 maart 2012 19:48
Aan: Patrick Breheny
CC: r-help@r-project.org
Onderwerp: Re: [R] gam - Y axis probability scale with confidence/error lines
Thank you. The binomial()$linkinv() is good to know.
Ben
On Wed
Hello,
How do I plot a gam fit object on probability (Y axis) vs raw values (X
axis) axis and include the confidence plot lines?
Details...
I'm using the gam function like this:
l_yx[,2] = log(l_yx[,2] + .0004)
fit - gam(y~s(x),data=as.data.frame(l_yx),family=binomial)
And I want to plot it so
The predict() function has an option 'se.fit' that returns what you are
asking for. If you set this equal to TRUE in your code:
pred - predict(fit,data.frame(x=xx),type=response,se.fit=TRUE)
will return a list with two elements, 'fit' and 'se.fit'. The pointwise
confidence intervals will
That was embarrassingly easy. Thanks again Patrick! Just correcting a
little typo to his reply. this is probably what he meant:
pred = predict(fit,data.frame(x=xx),type=response,se.fit=TRUE)
upper = pred$fit + 1.96 * pred$se.fit
lower = pred$fit - 1.96 * pred$se.fit
# For people who are
Actually, I responded a bit too quickly last time, without really
reading through your example carefully. You're fitting a logistic
regression model and plotting the results on the probability scale. The
better way to do what you propose is to obtain the confidence interval
on the scale of
Thank you. The binomial()$linkinv() is good to know.
Ben
On Wed, Mar 14, 2012 at 12:23 PM, Patrick Breheny
patrick.breh...@uky.eduwrote:
Actually, I responded a bit too quickly last time, without really reading
through your example carefully. You're fitting a logistic regression model
and
I've looked around and I just can't find anything that will work for my
needs. This is a bit of a 2 part question but pertaining to the same topic
so bare with me.
The first is with my qq plot. On the Y axis of my qq plot it'll have my
sample quantities but because my data is log-normal it'll
yaxt='n' in ?par and ?axis are your friends.
# A plot on log scale labeled with original:
plot(x,log(y),yaxt='n')
axis(2,at=pretty(log(y)),labels=round(exp(pretty(log(y)
Works for qqnorm and boxplots, as well as other top level fun.
By the way this is a FAQ.
On Fri, Feb 10, 2012 at 9:43
Hello everyone,
Is it possible to specify a 2 line y-axis label on the same lef-hand side
y-axis? I am using the \n regular expression, but only the 2nd line appears
(I assume the 1st line is printed off the page...)
plot(PRE_SHB,R1,
main=Figure 1.1: Scatterplot of Residualized
Post Score,
I think your assumption is correct. Have a look at ?par.
It's been a while but I think you need to modify the mai or mar values.
Probably the mar.
--- On Mon, 11/28/11, Dan Abner dan.abne...@gmail.com wrote:
From: Dan Abner dan.abne...@gmail.com
Subject: [R] 2 Y-AXIS labels on the same (left
(1,1, ylab = , xlab = )
title( ylab = Residualized Post Score \n (Adjusted for Age and
Gender), line=2)
--
David.
--- On Mon, 11/28/11, Dan Abner dan.abne...@gmail.com wrote:
From: Dan Abner dan.abne...@gmail.com
Subject: [R] 2 Y-AXIS labels on the same (left-hand side) Y-AXIS
To: r-help
Dear R-help team
I have tried hard to turn my Y axis 90 degrees, so that it is written
horizontally, and placing it above the Y axis, but I did not succeed.
I have tried to adapt the following functions:
- plot()
- title()
- mtext()
And some more that did not
On 24/11/2011 9:25 AM, Andres Christian wrote:
Dear R-help team
I have tried hard to turn my Y axis 90 degrees, so that it is written
horizontally, and placing it above the Y axis, but I did not succeed.
I have tried to adapt the following functions:
- plot()
- title()
-
: christian.and...@fibl.org
-Ursprüngliche Nachricht-
Von: Duncan Murdoch [mailto:murdoch.dun...@gmail.com]
Gesendet: Donnerstag, 24. November 2011 16:02
An: Andres Christian
Cc: R-help@r-project.org
Betreff: Re: [R] Horizontal Y axis title above the y axis
On 24/11/2011 9:25 AM, Andres
[mailto:murdoch.dun...@gmail.com]
Gesendet: Donnerstag, 24. November 2011 16:02
An: Andres Christian
Cc: R-help@r-project.org
Betreff: Re: [R] Horizontal Y axis title above the y axis
On 24/11/2011 9:25 AM, Andres Christian wrote:
Dear R-help team
I have tried hard to turn my Y axis 90 degrees, so
On 07/22/2011 07:16 AM, David Winsemius wrote:
Context added back in:
SamiC wrote:
Hi,
So I am trying to plot my results of a model. what i have is the
majority
of the data between the values of 0 and 30, then one outlier at 80 and
another at 130. the model plots a nice line through the
would be show in the graph. I think what i have seen is a graph with the
axis on one scale, then a squiggly line to another scale, and a squiggly
like to a third scale.
Thanks
--
View this message in context:
http://r.789695.n4.nabble.com/Changing-Y-axis-in-R-tp3683706p3683706.html
Sent from
On Jul 21, 2011, at 9:42 AM, SamiC wrote:
Hi,
So I am trying to plot my results of a model. what i have is the
majority
of the data between the values of 0 and 30, then one outlier at 80 and
another at 130. the model plots a nice line through the data
between 0 to
30, however given the
.n4.nabble.com/Changing-Y-axis-in-R-tp3683706p3685005.html
Sent from the R help mailing list archive at Nabble.com.
__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org
Context added back in:
SamiC wrote:
Hi,
So I am trying to plot my results of a model. what i have is the
majority
of the data between the values of 0 and 30, then one outlier at 80
and
another at 130. the model plots a nice line through the data
between 0 to
30, however given the
Thanks for sharing the idea, Walmes.
I am also trying to add err bars to the plots. So instead of using plot(), I
use errbar() from Hmisc package. Everything seems to work fine except I
couldn't find the argument to control the color of error bars. If I specify
col='red' in the errbar() it only
Dear list,
We have three time course profiles with very different scales, and we want
to show them in one plot. Is it possible to have three y axis? I guess not,
then what would be other options? something like two 2-y axis plots on a
three dimensional view? Appreciate any comment.
Jun Shen
There is nothing to prevent you from putting 3 y-axis on your plot;
might be confusing, but it can be done. What have you tried and why
do you say guess not? With the use of par(new=TRUE) or by doing
your own scaling, you can use 'axis' to put as many axises as you want
on your graph.
On Thu,
Hi, Jim,
Thanks for the information. But I am still not clear how to show the 3
separated Y axis. If I just call par(new=TRUE), the three axes are
overlapped.
attached some test data. Thanks.
Jun
=
structure(list(Time =
Try this:
plot(x$Time, x$y1, type='l', bty = 'c', col = 'red')
par(new = TRUE)
plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col
= 'green')
axis(4, col='green')
par(new = TRUE)
plot(x$Time, x$y3, type = 'l', axes = FALSE, xlab = '', ylab = '', col = 'blue')
axis(4,
Hi, jim
That's exactly what I wanted. One more trivial thing. How do I get rid the
border line on the top? Thanks again.
Jun
On Thu, May 26, 2011 at 11:20 AM, jim holtman jholt...@gmail.com wrote:
Try this:
plot(x$Time, x$y1, type='l', bty = 'c', col = 'red')
par(new = TRUE)
plot(x$Time,
I just found out by setting bty='l' to get rid of the border line on the
top.
On Thu, May 26, 2011 at 11:41 AM, Jun Shen jun.shen...@gmail.com wrote:
Hi, jim
That's exactly what I wanted. One more trivial thing. How do I get rid the
border line on the top? Thanks again.
Jun
On Thu, May
Jim,
One more question, how do I put a label on the axes I added? Thanks. I don't
see any argument in axis() for that? Thanks
Jun
On Thu, May 26, 2011 at 11:20 AM, jim holtman jholt...@gmail.com wrote:
Try this:
plot(x$Time, x$y1, type='l', bty = 'c', col = 'red')
par(new = TRUE)
On May 26, 2011, at 1:25 PM, Jun Shen wrote:
Jim,
One more question, how do I put a label on the axes I added? Thanks.
I don't
see any argument in axis() for that? Thanks
You don't see the `labels` argument in the help page for `axis`?
Jun
David Winsemius, MD
West Hartford, CT
David,
I surely tried the labels argument. But it seems for tick marks not for a
text label. Did you see a different outcome? Thanks.
Jun
On Thu, May 26, 2011 at 12:38 PM, David Winsemius dwinsem...@comcast.netwrote:
On May 26, 2011, at 1:25 PM, Jun Shen wrote:
Jim,
One more question,
You can use mtext()
par(mar=c(5.1,4.1,4.1,5.1))
plot(x$Time, x$y1, type='l', bty = 'c', col = 'red')
par(new = TRUE)
plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col=
'green')
axis(4, col='green')
mtext(side=4, text=label green, line=2)
par(new = TRUE)
plot(x$Time, x$y3,
On May 26, 2011, at 2:18 PM, Jun Shen wrote:
David,
I surely tried the labels argument. But it seems for tick marks not
for a text label. Did you see a different outcome? Thanks.
`labels` is for labels, `at` is for tick (and label) locations. They
should be the same length. One label
Thanks a bunch, Walmes.
One more concern, the new Y axes added do not extend all the way down to
cross with x axis. Is there anyway to make them look like the very first Y
axis on the left?
Jun
On Thu, May 26, 2011 at 1:24 PM, Walmes Zeviani walmeszevi...@gmail.comwrote:
You can use mtext()
You can pass a vector of ticks to the axis() function that expand the actual
range,
par(mar=c(5.1,4.1,4.1,5.1))
plot(x$Time, x$y1, type='l', bty = 'c', col = 'red')
par(new = TRUE)
plot(x$Time, x$y2, type = 'l', axes = FALSE, xlab = '', ylab = '', col=
'green')
##axis(4, col='green')
axis(4,
On 27/05/11 03:35, Jun Shen wrote:
Dear list,
We have three time course profiles with very different scales, and we want
to show them in one plot. Is it possible to have three y axis? I guess not,
then what would be other options? something like two 2-y axis plots on a
three dimensional view?
1 - 100 of 175 matches
Mail list logo