Dear Sir,

Thanks again for your help. Sir, actually I am working on a data containing 84 months and the corresponding savings (core) balances and non-core balances and I am plotting a stacked bar.

The original code I am using is as follows

x = read.csv('core-noncore.csv')

x2 <- data.frame(rep(x$month, 2), stack(x, select = -month))   
names(x2) <- c('month', 'Count', 'Type')
library(lattice)
barchart(Count ~ month, groups = Type, data =x2, horizontal = FALSE, stack =TRUE, auto.key = list(columns = 2))       # stacked  vertical bar chart

However, when I try to apply the code given by you, its showing the error 
"plot.new has not been called yet"

Sir, is it that the command works only with plot command and not with barchart.

Warm regards

Julia


************************************************



Only a man of Worth sees Worth in other men



************************************************

--- On Fri, 11/27/09, Dennis Murphy <djmuser@gmail.com> wrote:

From: Dennis Murphy <djmuser@gmail.com>
Subject: Re: [R] Overlapping x - axis lables

Date: Friday, November 27, 2009, 6:36 AM

Hi Julia:

Two things:
  (i) use axes = FALSE in your initial call to plot();
  (ii) use axis(1, at = 10 * (0:10))   if you want it by tens, for example
                axis(2)      # use default
                box()         # if you want a box around the plot.

?axis is your friend here.

HTH,
Dennis



Dear R helpers



Suppose I am plotting a simple scatter plot where no of paired observations (x,y) are say 100.





month          length

1                   10

2                   12

3                   17

4                   21

5                   13

..........................

..........................

..........................



100              16







when i run the command



plot(month, length)



the required plot is generated. But the problem is that on  the X - axis, month values are also printed and it becomes difficult to read the month values on the graph.

 

(Actually I am working on a stacked graph where I am facing this problem..)



So, how to display only few month values (say 1, 5, 10 and so on) without affecting the original graph i.e. the graph should display all the data 100 points but on x - axix only few month values should be displayed in order to improve the readability.




Thanking in advance



Julia









************************************************







Only a man of Worth sees Worth in other men







************************************************







        [[alternative HTML version deleted]]




______________________________________________

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/posting-guide.html

and provide commented, minimal, self-contained, reproducible code.







      
	[[alternative HTML version deleted]]


