[R] How to change the number of axis?

Jim Lemon jim at bitwrit.com.au
Fri Mar 16 08:47:14 CET 2012

On 03/16/2012 01:28 AM, qiao xue wrote:
> Hi,
> I use R to plot a graph with 20000 frames. Because the limit of pixel
> or others, the screen fail to show the graph. So I have to draw a
> point every 10 frames. So the total of x axis becomes 2000.
> So when imaging the picture, I still hope that the total of x-axis is
> 20000.  I need to find a way to modify the number of axis.
> How could I do this?
Hi Qiao,
Let's assume that you want a scatterplot:

# first let's indulge our secret desire to make up data
# now plot this data
# Wow! Pretty messy. Now take the mean of every ten
# values to get a vector of 2000 values
for(i in 2:2000) x10<-c(x10,mean(x[(i*10):(i*10+9)]))
# when plotting this, add the x values, which were
# previously just made up from the length of the vector


More information about the R-help mailing list