ABSTRACT

Both R and MATLAB include facilities for producing a wide variety of high-quality graphics. Both platforms have fairly straightforward and similar ways of producing simple scatterplots of 2-D data, with a large set of additional routines to modify those plots or produce other types of graphical output. R has two fundamentally different ways of producing graphics (what are called graphics systems): the traditional graphics system and the grid graphics system. In both environments, figure windows can be identified via integers, referred to as device numbers (R) or figure numbers (MATLAB). One of the simplest and perhaps most common type of graphics is a scatterplot of (x, y) data. The color used in a plot can be specified via a col parameter to the plot function. Sometimes, after plotting some data, people wish to add additional plots within the same figure window. It is fairly straightforward to do this in both platforms, but there are some key differences between the two.