piermorel/gramm

How to set the color of geom_raster?

Gery111 opened this issue · 4 comments

hello,
I'm trying to use gramm to plot the firing of spike train, but I find the arguements are only geom"line" and geom "point".
I want to show the data that every row has one timestamp in other color, or some row have one color, some row have another color, like this:
批注 2019-12-16 120046
批注 2019-12-16 120148

Could I do this in Gramm?
Thank you

Using update can do this.

Update should likely not be used for this : the whole point of gramm is that you can provide a grouping variable that will set the color automatically whatever the geom_ used. You just give a 'color' argument in the first gramm() call and you are good to go provided your trials are ordered. There is an example in examples.m

@piermorel
Hello, Piermorel,
Yes, set gramm( "color", group variable) could set the color of different rows, but it looks cannot set different color in one row.
I am trying to use
gramm('x',spiketime1, 'color', group) set_color_option(one color) update('x', timestamp) set_color_option(another color)
and it works. I can make one row has two color of dots. Even I still do not know how to set one row that has more than two colors, because if I use update twice, the first call is missed.

It seems that you reached the limit of what could be done within gramm unfortunately...