[R] A graph with a positive y-axis intercept

arun smartpink111 at yahoo.com
Thu Jul 19 23:40:03 CEST 2012


I guess you wanted to change the scale of Y-axis:



----- Original Message -----
From: "Lekgatlhamang, lexi Setlhare" <lexisetlhare at yahoo.com>
To: "r-help at stat.math.ethz.ch" <r-help at stat.math.ethz.ch>
Sent: Thursday, July 19, 2012 5:31 PM
Subject: [R] A graph with a positive y-axis intercept

Dear all,
I have a challenge with a supposedly simple graph (a scatter). I wanted to use R to create a plot/graph with a positive y-axis intercept but it does not seem to give me what I expect to see. As an example, I used the following values
> X<- c(0, 4, 8, 11)
> Y<- c(8, 12, 15, 22)

then I used the plot function in the base package
> plot(X, Y)
This gave me a graph which might be mistaken to be starting from the origin, and yet, using the same numbers in Excel, and plotting them using the scatter option, I get a graph which clearly has a positive y-axis intercept.
Please help.
    [[alternative HTML version deleted]]

R-help at r-project.org mailing list
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