Skip navigation

High resolution and SVG versions of the new R logo are finally available.

I converted the SVG to WKT (file here) which means we can use it like we would a shapefile in R. That includes plotting!

Here’s a short example of how to read that WKT and plot the logo using ggplot2:

r_wkt_gist_file <- ""
if (!file.exists("rlogo.wkt")) download.file(r_wkt_gist_file, "rlogo.wkt")
rlogo <- readWKT(paste0(readLines("rlogo.wkt", warn=FALSE)))
rlogo_shp <- SpatialPolygonsDataFrame(rlogo, data.frame(poly=c("halo", "r")))
rlogo_poly <- fortify(rlogo_shp, region="poly")
ggplot(rlogo_poly) + 
  geom_polygon(aes(x=long, y=lat, group=id, fill=id)) + 
  scale_fill_manual(values=c(halo="#b8babf", r="#1e63b5")) +
  coord_equal() + 
  theme_map() + 



  1. Wow. But you could just do it in base much more easily using plot. Just replace the ggplot() nonsense with:

    plot(rlogo_shp, col=c(“#b8babf”, “#1e63b5”), lty=0)

    • I will (grudgingly :-) award base plotting a singular advantage over ggplot2 here :-)

      Having said that, “base” is getting help from an inherited sp::plot method for the SpatialPolygonsDataFrame class which ends up calling the S4 method for plotting SpatialPolygons which is actually doing far more work than you may realize under the covers:

      So, you’re really saying that the sp pkg authors failed to make a set of autoplot() S3 methods for Spatial… objects to give ggplot2 users the same crutch base graphics users already have :-)

  2. Neat!

  3. Hello,

    I am looking into Rlogo use. It is licensed CC-BY-SA (, any way to automatically insert the needed links and reference in the caption ?

One Trackback/Pingback

  1. […] article was first published on R –, and kindly contributed to […]

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.