0

Although it might sound easy at first, I do not have a scatterplot. And I think that is what make this question challenging. I am having this plot, which comes from this question.

enter image description here

Summing up, each axis represents a variable that is not connected to the other. It is not an XY scatterplot, as you see.

I wonder to know if there is any possibility to trace the 95% confidence interval for the mean in both variables, and draw a square in the middle of the plot representing the overlapping area among both datasets.

The result might be something similar to this, bearing in mind that 95CL represented do not correspond to reality (just for the sake of illustrating how it might appear): enter image description here

Here is a another question which deals with this situation, but not using ggplot.

antecessor
  • 2,688
  • 6
  • 29
  • 61
  • Sure, take a look at `annotate`. You can use it to make a rectangle with the coordinates of your upper and lower limits – camille May 30 '18 at 14:09
  • Thanks for the suggestion @camille. Would you mind explaining further the `annotate` function with the example? – antecessor May 30 '18 at 14:25
  • I'm messing around with this now, but are you sure you wouldn't prefer something more standard and straightforward like 2d binning? This has a geom built into ggplot – camille May 30 '18 at 15:01
  • Thanks again. I really appreciate your efforts. I am also trying with annotate and geom_rect, but with no results. Hope you find a solution @camille ... – antecessor May 30 '18 at 15:08
  • And also, if you get to other option to represent what I want, either with ggplot or binding, I am open to study the code – antecessor May 30 '18 at 15:10

0 Answers0