[R] Struggling trying to plot points on boxplot

Thomas Adams tea3rd at gmail.com
Thu Jun 2 17:36:59 CEST 2016


Hello all:

I've been beating my head on this for over a day and I have done a lot of
Google'ing with no luck.

I have generated a 'time-series' of boxplots (227), covering more than a
30-day period at 6-hour intervals, which summarize an ensemble forecast.
What I want to do is over-plot the observed values over a portion of the
forecast period to serve as a basis of comparison; so, there would be a
boxplot and a single point value plotted at each 6-hour interval.

The boxplots are generated:

zz<-boxplot(ens$value ~ ens$valid_time,xlab="Date/Time
(UTC)",ylab="Flow(cfs)",boxfill="cyan")

which works fine, but the observed points will not display using:

points(zz, obs$value,lty=3,lwd=1,col="red",pch=19)

I've tried many variations of the latter, where either nothing happens and
no error is returned or I have also gotten that x and y have different
lengths. I suspect I am using the wrong 'x' type. I have observation values
beginning with the first in the series of boxplots, which then end, with
the most recent ensemble forecast. So, I always expect the number of
observed values to be less than the number of boxplots. I have done this
previously, years ago, but can not find my notes and can not reconstruct
what I did.

Help is appreciated.

Regards,
Tom

	[[alternative HTML version deleted]]



More information about the R-help mailing list