Re: [R] Barplot for degree distribution

From: David Winsemius <dwinsemius_at_comcast.net>
Date: Wed, 27 Apr 2011 09:03:36 -0400

On Apr 27, 2011, at 12:00 AM, kparamas wrote:

> Thanks for the info.
>
> I have 2 degree distributions that have different degrees.

Do you mean a different range of values?

>
> I want both these barplots to have the same axes. Is this possible?
> I have used xlim and ylim. ylim works fine for both plots
> But xlim I am not getting the values till 60. And if I give
> names(dd) <-
> 0:60 it gives an error.

An error you say? .... WHICH ERROR?

>
> library(igraph)
> names(dd1) <- 0:18
> barplot(dd1, cex.names = 0.8, ylim = c(0, 0.3), xlim = c(0, 60)
> cex.axis = 0.8, xlab = 'Degrees', ylab = 'Relative
> frequency')
>
> names(dd2) <- 0:50
> barplot(dd2, cex.names = 0.8, ylim = c(0, 0.3), xlim = c(0, 60)
> cex.axis = 0.8, xlab = 'Degrees', ylab = 'Relative
> frequency')

Without the data, this will remain a difficult guessing exercise. My guess is that you have a column that you think is numeric but is really a factor.

-- 

David Winsemius, MD
West Hartford, CT

______________________________________________
R-help_at_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.
Received on Wed 27 Apr 2011 - 13:07:05 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Wed 27 Apr 2011 - 13:10:34 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive