0

I have two equally sized datasets (~20,000 rows each) For each dataset I have an X and a Y score, and I want to show that the two datasets have different distributions. However, when I plot this (even with transparency, alpha=.5 or alpha=.3) the second distribution plotted blocks the first one: The X axis is the first score, the Y axis is the second score. Grey points are plotted over black points

I want to use something like smoothScatter for the grey points (https://www.rdocumentation.org/packages/graphics/versions/3.4.0/topics/smoothScatter), but cannot figure out how to plot a smooth scatter plot over a regular one.

Any suggestions for either how to plot a smoothScatter plot over a regular plot, or more generally how to plot the dense grey points over the dense black points?

Just to clarify: Both the black and grey points are very dense in the diagonal, although grey is more dense. The grey points have few points slightly off the diagonal, so adjusting the transparency makes those off diagonal points fade away, which I do not want to do either.

Josh
  • 1,155
  • 4
  • 12
  • 21
  • have you tried using `points` ? – Bea May 30 '17 at 15:12
  • @GyB yes I have. Using black points over grey (or vice versa) still causes a problem. Even black points of smoothScatter for grey hides the grey points. – Josh May 30 '17 at 15:33
  • Can you provide a reproducible example data as well as the code you have tried? – Bea May 30 '17 at 15:36
  • How/where do I put such data? – Josh May 30 '17 at 15:39
  • You can add it to your post above by editing it. Some tips [here](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) – Bea May 30 '17 at 15:44
  • Not really what you're asking, but for this example, what about superimposing the histograms of (Score2-Score1) for each dataset? It would be more readable. – Lamia May 30 '17 at 17:39

0 Answers0