overlay ggplot graphs like those merging channels in imagej
1
0
Entering edit mode
21 months ago
cwwong13 ▴ 40

I wonder if there is a way/package that provides a means to overlay plots (I am thinking of a scatter plot generated by geom_point) in a way similar to overlaying channels in ImageJ.

I would like to check if the two points are overlapped. Visually, a red pixel and green pixel overlay will turn yellow if done in ImageJ. However, the closest I can get to getting a similar result is to set the alpha of the point in geom_point. However, the color is not exactly yellow.

Therefore, I would like to know if there is a way I can produce a similar plot in R.

ggplot imagej • 615 views
ADD COMMENT
0
Entering edit mode
21 months ago
LChart 4.5k

Can you show an example of your data? The big difference is that for channel overlay, the underlying datagrid is the same:

x   y   v
1   1   0.1
1   2   0.1
..  ..  ..
1   n   0.0
2   1   0.1
2   2   0.2
..  ..  ..
k   n   0.0

so you could conceviably combine with paste0('#', as.hexmode(255*ch1$v), as.hexmode(255*ch2$v), as.hexmode(255*ch3$v)).

However if you have a bona-fide scatter plot (x and y not aligned) then you'll need to approximate v(x,y) using some kind of interpolation.

ADD COMMENT

Login before adding your answer.

Traffic: 1811 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6