kenithgrey / ggQC

ggQC
GNU General Public License v3.0
46 stars 9 forks source link

Residual Points Persist in X-bar Chart #51

Open drag05 opened 1 year ago

drag05 commented 1 year ago

The image below shows black points inside green points on an X-bar chart built by following the example in this vignette (plot title removed). The green larger points were set by my code (below). However the default black points persist. I have changed the order of layers setting individual measurement points first (faded gray) followed by average measurements green points with zero transparency and the faded points seem to have been masked by the green points. The black points together with the lines however, are not masked by the green points.

ggQC package version: 0.0.31

Thank you!

Xbar_plot

Xbar = lapply(unique(VectorData), function(i) {
       ggplot(dtt[Item %in% i], aes(x = Sample, y = .data[['Area/\u03BCL']], group = 1L)) +
       theme_bw() + geom_point(alpha = 0.2, size = 2) +
       stat_summary(fun = 'mean', geom = 'point', size = 4, color = '#17b903') + 
       stat_summary(fun = 'mean', geom = 'line') + 
       theme(axis.text.x = element_text(size = 6, angle = 90, vjust = 0.5, hjust=1)) +
       ggtitle(sprintf('%s  | Item : %s', equip, i)) + 
       scale_x_discrete(expand = expansion(add = c(1L, 2L))) +
       stat_QC() + stat_QC_labels(text.size = 2)
    })