BigelowLab / gom-series

1 stars 4 forks source link

profile along top of surprise plot #28

Open btupper opened 1 year ago

btupper commented 1 year ago

Ahoy @chross22 and @jevanilla ! @SeascapeScience posed this question about adding a profile along the top of the heatmap... I have done in base R but never in grid graphics like ggplot. I can compute the profile, but how does one draw it? It might be that the generate the object ala p = ggplot() + ... then fish around in the object looking for the bounding box of the heatmap. Then what? Transform the profile to "heat map coordinates" and add as geom_line()?

I chatted with Andy P last night about our surprises paper. He had a pretty good idea..

On the surprise plot, add a line across the top that shows the proportion of boxes below it that are surprises. I’ve started sketching roughly what it would look like in the image below.

Screenshot 2023-08-24 at 10 34 43 AM
btupper commented 1 year ago

Hmmm, maybe this? https://deanattali.com/2015/03/29/ggExtra-r-package/

jevanilla commented 1 year ago

Seems like a good call. I'd like to see the line and bar versions.

SeascapeScience commented 1 year ago

Bars could look good!

btupper commented 1 year ago

The line looks like a sick worm. But the bars look OK - they get squished as the plot window area gets eaten up by the heatmap. Here's an example...

marginal

SeascapeScience commented 1 year ago

Thumbs up for the squished sick worm.

btupper commented 1 year ago

Take a look at the readme here I'm not convinced that the profile along the top is very compelling to the large story. Plus it chews up a lot of space.

I'm glad we have switched to surperimposed binary dots (surprise! no surprise). The matchup is much easier to identify, but it does raise issues (to my eye) that I discuss in the readme. It all does come down to the threshold (there's ALWAYS a threshold!)