[R] Setting fixed size for segement plot using stars() (axes size vs print size)

From: Jay Douillard <jay.douillard_at_ubc.ca>
Date: Wed, 30 Jul 2008 12:04:11 -0700 (PDT)

I have been making some segment plots with five variables. They work great, especially when I used a different scale function, which scaled them by area of the circle rather than radius

scale <- function(x, Mr = 1 , Mx = 100) { ((x/Mx)^.5)*Mr}

Where x is the the value, Mr is the Maximum radius, and Mx is the maximum data value. You could change the exponent .5 to .57 if you wanted Flannery compensation.

My problem is that I want the print size of these proportional symbols to be the same regardless of the number of data points

as in this example, where exporting these two plots as PDF(which have been scaled) will produce different size symbols for the same value, when compared side by side.I've tried manually setting the ncol and nrow attributes, and it still produces different results for the data sets.

stars(large[2:6], draw.segments = TRUE, labels = large$size,scale = FALSE, flip.labels = TRUE, axes = TRUE,) stars(small[2:6], draw.segments = TRUE, labels = small$size,scale = FALSE, flip.labels = TRUE, axes = TRUE,)

Thanks!

small <-
structure(list(size = c(5, 10, 15, 20, 25, 30, 50), one = c(0.223606797749979,

0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548), two = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548), three = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548), four = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548), five = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548)), .Names = c("size", "one", 

"two", "three", "four", "five"), row.names = c(NA, 7L), class = "data.frame")

large <-
structure(list(size = c(5L, 10L, 15L, 20L, 25L, 30L, 50L, 5L, 10L, 15L, 20L, 25L, 30L, 50L, 5L, 10L, 15L, 20L, 25L, 30L, 50L,

5L, 10L, 15L, 20L, 25L, 30L, 50L), one = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548, 0.223606797749979, 0.316227766016838, 
0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 
0.707106781186548, 0.223606797749979, 0.316227766016838, 0.387298334620742, 
0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548, 
0.223606797749979, 0.316227766016838, 0.387298334620742, 0.447213595499958, 
0.5, 0.547722557505166, 0.707106781186548), two = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548, 0.223606797749979, 0.316227766016838, 
0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 
0.707106781186548, 0.223606797749979, 0.316227766016838, 0.387298334620742, 
0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548, 
0.223606797749979, 0.316227766016838, 0.387298334620742, 0.447213595499958, 
0.5, 0.547722557505166, 0.707106781186548), three = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548, 0.223606797749979, 0.316227766016838, 
0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 
0.707106781186548, 0.223606797749979, 0.316227766016838, 0.387298334620742, 
0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548, 
0.223606797749979, 0.316227766016838, 0.387298334620742, 0.447213595499958, 
0.5, 0.547722557505166, 0.707106781186548), four = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548, 0.223606797749979, 0.316227766016838, 
0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 
0.707106781186548, 0.223606797749979, 0.316227766016838, 0.387298334620742, 
0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548, 
0.223606797749979, 0.316227766016838, 0.387298334620742, 0.447213595499958, 
0.5, 0.547722557505166, 0.707106781186548), five = c(0.223606797749979, 
0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 
0.547722557505166, 0.707106781186548, 0.223606797749979, 0.316227766016838, 
0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 
0.707106781186548, 0.223606797749979, 0.316227766016838, 0.387298334620742, 
0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548, 
0.223606797749979, 0.316227766016838, 0.387298334620742, 0.447213595499958, 0.5, 0.547722557505166, 0.707106781186548)), .Names = c("size",
"one", "two", "three", "four", "five"), row.names = c(NA, -28L
), class = "data.frame")

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 30 Jul 2008 - 19:06:47 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 Fri 08 Aug 2008 - 19:33:24 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