Graphs


R Graphics CookbookGraphs - 图2

My book about data visualization in R is available! The book covers many of the same topics as the Graphs and Data Manipulation sections of this website, but it goes into more depth and covers a broader range of techniques. You can preview it at Google Books.

Purchase it from Amazon,Graphs - 图3 or direct from O'Reilly.Graphs - 图4


There are many ways of making graphs in R, each with its advantages and disadvantages. The focus here is on the ggplot2 package, which is based on the Grammar of Graphics (by Leland Wilkinson) to describe data graphics.

Graphs with ggplot2

Miscellaneous

  • Output to a file - PDF, PNG, TIFF, SVG
  • Shapes and line types - Set the shape of points and patterns used in lines.
  • Fonts - Use different fonts in your graphs
  • Antialiased bitmap output - If your plots look jagged or pixelated. (Not yet finished)

Basic graphs with standard graphics

Other interesting graphs

Useful links