Skip to content
Back to formatted view

Raw Message

Message-ID: <4973848C.2020402@gmx.de>
Date: 2009-01-18T19:35:40Z
From: Stephan Kolassa
Subject: Formatting the axis of plot() to shown our own values.
In-Reply-To: <21529473.post@talk.nabble.com>

Hi Saurabh

saurabh_koparkar schrieb:
> Part 1: 
> I want to plot the CO2 concentration vs. year, but extending the x-axis
> using the xlim parameter to include the year 2006 (x axis range of values
> are from -41210 to 0), and adjusting the ylim parameter to go up to 400 when
> the range of y axis values are from 150 to 300. How do I do this? Using axis
> function? I am confused about the syntax here. 

plot(year,co2,xlim=c(-41210,2006),ylim=c(150,400))

> Part 2:
> I also want to use the points() function to add the data points from years
> 1958-2006 on X axis to the above plot, but in a different color. 

points(...,...,bg="red")

Perhaps also col="red" - may depend on what character (pch=..) you are 
plotting.

HTH,
Stephan