ggplot2

Multiple layers in ggplot2 with different datasets

Hi, I have a contour plot and I would like to add a geom_path with a different set of data over it. Right now I have the below code, but as soon as it gets to the geom_path, it overwrites the contour plot. Is there a way to prevent this from happening? v <- ggplot(pts, aes(theta_1, theta_2, z = z)) v + stat_contour(aes(colour = ..leve...

ggplot: boxplot sort

How do I sort a boxplot in ggplot? Here's what I'm trying to plot: qplot( row.names(pcaDF),pcaDF[,1],data=pcaDF,geom="boxplot") + coord_flip() and here's the structure of pcaDF > str(pcaDF) 'data.frame': 108 obs. of 1 variable: $ sort(plotdata[, 1], decreasing = F): num -5.89 -5.52 -4.66 -4.54 -3.92 ... ...