fill patter

10 views
Skip to first unread message

Etienne Low-Decarie

unread,
Mar 21, 2013, 2:33:56 PM3/21/13
to ggplo...@googlegroups.com
Is there any way to use a pattern rather than a colour for mapping fill?  I have recently encountered difficulty presenting data to colour blind people and in printing in black and white.

Along the lines of what is available in gridExtra:

grid.pattern(x=seq(1/6, 5/6, length=6), width=unit(1/8,"npc"), height=unit(0.5,"npc"),
+              motif.width=unit(10, "mm"),  pattern=c(1:6), orientation=45, motif.alpha=0.5,
+              motif.cex=c(1, 0.5), motif.col=1:2, motif.fill=NA,
+              gp=gpar(fill="blue", lwd=2, alpha=0.5),  clip=TRUE)


Thank you,

Etienne

baptiste auguie

unread,
Mar 21, 2013, 4:29:47 PM3/21/13
to Etienne Low-Decarie, ggplo...@googlegroups.com
AFAIK there's no such possibility with ggplot2 (or grid graphics, really), probably because no-one sees it as a worthwhile feature to implement. If you absolutely need fill patterns, your best bet might be to have a go at processing the plot in svg format which natively supports fill patterns with arbitrary clipping (gridSVG has tools for such processing, it should work in theory with reasonably low effort).

HTH,

b.



--
You received this message because you are subscribed to the Google Groups "ggplot2-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ggplot2-dev...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages