[R] Color of CI bars in Hmisc::Dotplot()

From: Michael Kubovy <kubovy_at_virginia.edu>
Date: Sun, 24 Feb 2008 17:33:12 -0500


Dear R-helpers,

(1) I can't figure out how to tell Dotplot that I want the colors of
the CI bars to be the same as the colors of the dots.

For example:
t2a.ci3 <- data.frame(est = c(7, 20, 75), lower = c(-9, 0.5, 42), upper = c(22, 39, 109))
mypal <- c('skyblue3', 'mistyrose3')
condNames <- c('noise', 'horn', 'marimba') Dotplot(1:2 ~ Cbind(est, lower, upper), data = t2a.ci3,

	scales = list(y = list(at = 1:2, labels = condNames)),
	ylab = '',
	xlab = 'rated duration', aspect = 0.2,
	ylim = c(0.5, 2.5), panel = function(x, y){
		panel.Dotplot(
				x, y, col = mypal[c(1, 2)],
					col.segments = mypal[c(1, 2)])
		panel.abline(v = 50, col.line = 'red', lty = 2)}
)

My guess was "col.segments" but that doesn't do the trick.

(2) How do I insure that as I change the number of lines and ylim I
just change the the height of the y-axis, keep the distance between horizontal lines constant, and do not add white space above and below the figure? This shows how white space changes:

Dotplot(1:3 ~ Cbind(est, lower, upper), data = t2a.ci3,

	scales = list(y = list(at = 1:3, labels = condNames)),
	ylab = '',
	xlab = 'rated duration', aspect = 0.3,
	ylim = c(0.5, 3.5), panel = function(x, y){
		panel.Dotplot(
				x, y, col = mypal[c(1, 2, 1)],
					col.segments = mypal[c(1, 2, 1)])
		panel.abline(v = 50, col.line = 'red', lty = 2)}
)

Professor Michael Kubovy
University of Virginia
Department of Psychology
USPS:     P.O.Box 400400    Charlottesville, VA 22904-4400
Parcels:    Room 102        Gilmer Hall
         McCormick Road    Charlottesville, VA 22903
Office:    B011    +1-434-982-4729
Lab:        B019    +1-434-982-4751
Fax:        +1-434-982-4766

WWW: http://www.people.virginia.edu/~mk9y/

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 Sun 24 Feb 2008 - 22:36:29 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 Sun 24 Feb 2008 - 23:30:16 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