MUCollective / pgog

Supplemental to A Probabilistic Grammar of Graphics
14 stars 1 forks source link

Default aes seem to work but not the user supplied ones #9

Open xiaoyingpu opened 5 years ago

xiaoyingpu commented 5 years ago

https://github.com/MUCollective/uncertainty-gog/blob/d4af1ada29a3dee27fcca1d72ab38ab46f0549ab/R/geom-icon.R#L6-L9

User-supplied color or fill not working. Can also be related to #41

Two problems

xiaoyingpu commented 5 years ago

Prob has something to do with inheriting geom_point

citywallum commented 4 years ago

1/21 Observations: fill is kept in variable "mapping" in geom_bloc(), is lost in the process of function "ggplot2::layer"; Productplot uses a different technique to generate plot. e.g. element "data" in the structure for plotting productplot poccesses information of each blocks(t,b,r,l, etc), but it is empty in the environment for plotting geom_bloc(not sure what happens in ggplot2::layer but pretty sure that we can not just do +aes(fill = cyl) to change fill color, as what is done in productplot)

citywallum commented 4 years ago

Add fill variable into "res" in stat_bloc by "fill_var". But still unable to change color. Guess: something to do with "data" and "mapping". Compared to productplot, and "data" in productplot doesn't include fill cariable too.

xiaoyingpu commented 4 years ago

Untitled

@citywallum can confirm that it is going to work if you secretly add a fill column

citywallum commented 4 years ago

interesting... oh i see the possible reason that color didn't change when I added "fill" column is that I didn't factor cyl。.