Skip to content
Back to formatted view

Raw Message

Message-ID: <CAAjHrnNpo6aK=7cmKQYPM-g=5pxajf4GmVx5BEQq7A=6tVGa+A@mail.gmail.com>
Date: 2017-06-20T05:18:24Z
From: Yogesh Gupta
Subject: error while creating a simple graph

Dear All,

I am learning R so it's a very simple problem but I do not understand while
I am not able to generate a graph from two vectors.

when I type this code, it generates a very nice graph.

 pdf("mygraph.pdf")
> attach(mtcars)
> plot(wt,mpg)
> abline(lm(mpg~wt))
> title("Regreesion of mpg")
> detach(mtcars)
> dev.off()

But I am trying to create a graph from this code, it generates a pdf with
nothing.


> dev.new()
> pdf("test.pdf")
> x <- c(1,3,6,9,12)
> y <- c(1.5,2,7,8,15)
> plot(x,y)


Thanks
Yogesh

	[[alternative HTML version deleted]]