Graphing – margins, titles, mtext, workspace

This is a great post, very true, not enough of R’s graphics are well displayed online to really see how to achieve what the often ambiguous ‘help’ information suggests.

I particularly find “mtext(“lol”, outer=T)” to be particularly useful (requires “oma=c(2,2,2,2)” or similar). This site is somewhat of the way there, but I’ve found seeing the actual code to be rather clumsy.

2 thoughts on “Graphing – margins, titles, mtext, workspace

  1. I have 14 series and I want to plot them in a single graph.
    I write the code, but when I want to plot all graph’s, them are to small and elongated.

    I try this, but for 14 chart this code is unsatisfactory.
    par(oma=c(4,2,1,1)); par(mar=c(2,5,0,1))

  2. Hi catalinroibu, I’m not an expert of graphing so can only offer my anecdotal advice. Have you considered using either the ggplot2 package or the lattice package? ggplot2 is great but has a bit of a learning curve, you can see on this page there is a specific function for plotting data across multiple plots, this without the burden of so much white space and padding in between each plot. Another thing to consider, is regardless of oma and mar settings, how do you think 14 plots in one image will look? Depending on the number of data points in each it may just be way too much for anyone to take in, maybe some of them can be on the same axis with a legend to differentiate? Just a few suggestions of different functions to use and possible ways to approach your problem, hope that helps.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s