Skip to content
Back to formatted view

Raw Message

Message-ID: <YEjUaj4o/3yqk5+x@posteo.no>
Date: 2021-03-10T14:15:06Z
From: Rasmus Liland
Subject: Color in stripchart
In-Reply-To: <8a2ed06b-dff2-17ea-1bee-785b420a3c74@math.uni-giessen.de>

Dear Robin and Gerrit,

I am unable to see the difference in the 
plot in the two cases ... 

	df <- data.frame(year = seq(2011, 2018), value = seq(10, 80, 10))
	df$color <- 'black'
	df[df$value<33,]$color <- 'blue'
	df[df$value>66,]$color <- 'red'
	
	file <- "/tmp/robin.png"
	width <- 1000
	height <- 1000
	res <- 150
	png(file=file, width=width, height=height, res=res)
	par(mfrow=c(2,1))
	
	stripchart(df$value ~ df$year, pch=18, col=df$color, method='stack', main="stripchart with color column as col")
	
	stripchart(df$value ~ df$year, pch=18, method='stack', main="stripchart with black basis")
	points(df[df$color=='blue',]$value, df[df$color=='blue',]$year-2010,
	type='p', pch=18, col='blue')
	points(df[df$color=='red',]$value, df[df$color=='red',]$year-2010,
	type='p', pch=18, col='red')
	
	dev.off()

Best,
Rasmus

-------------- next part --------------
A non-text attachment was scrubbed...
Name: robin.png
Type: image/png
Size: 38927 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210310/5862f5ba/attachment.png>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://stat.ethz.ch/pipermail/r-help/attachments/20210310/5862f5ba/attachment.sig>