When I want to insert figures generated in R into a LaTeX document, it looks better if I first remove the white space around the figure. Unfortunately, R does not make this easy as the graphs are generated to look good on a screen, not in a document. There are two things that can be done to fix this problem.
Posts Tagged ‘graphics’:
LaTeX loops
Today I was writing a report which included 20 figures, with the names demandplot1.pdf, demandplot2.pdf, …, demandplot20.pdf, and all with similar captions. Clearly a loop was required. After all, LaTeX is a programming language, so we should be able to take advantage of its capabilities.
The Young Stats Communication Challenge
The Australian Young Statisticians Conference (Feb 2013) is organizing a communication competition. They invite all early-career statisticians (studying, or within 5 years of graduation) to produce a short (3−5 minute) video for the ABS YSC2013 Video Competition, or a static infographic for the ABS YSC2013 Infographic Competition. Both competitions have a 1st prize of
250. Entries close 16th November, and winners will be notified by mid-December. Details available at: ysc2013.com/program/competitions/ I’m a speaker at the conference, so hopefully I will get to see some of the great entries!
Data visualization
For those who have not read the seminal works of Tufte and Cleveland, please hang your heads in shame. To salvage some sense of self-worth, you can then head over to Solomon Messing’s blog where he is starting a series on data visualization based on the principles developed by Tufte and Cleveland (with R examples). The classics are also worth reading, and remain relevant despite the 20 or 30 years that have elapsed since they appeared.
Data visualization videos
Probably everyone has seen Hans Rosling’s famous TED talk by now. If not, here it is: I recently came across a couple of other exceptional talks on data visualization: Hans Rosling again: “Let my dataset change your mindset”. If only all statistics lecturers were this dynamic! David McCandless: “The beauty of data visualization”. Not so exciting as Hans, but some great examples. And here’s an hour-length documentary hosted by Hans Rosling called “The Joy of Stats”.
Animated plots in R and LaTeX
I like to use animated plots in my talks on functional time series, partly because it is the only way to really see what is going on with changes in the shapes of curves over time, and also because audiences love them! Here is how it is done.
Twenty rules for good graphics
One of the things I repeatedly include in referee reports, and in my responses to authors who have submitted papers to the International Journal of Forecasting, are comments designed to include the quality of the graphics. Recently someone asked on stats.stackexchange.com about best practices for producing plots. So I thought it might be helpful to collate some of the answers given there and add a few comments of my own taken from things I’ve written for authors. The following “rules” are in no particular order. Use vector graphics such as eps or pdf. These scale properly and do not look fuzzy when enlarged. Do not use jpeg, bmp or png files as these will look fuzzy when enlarged, or if saved at very high resolutions will be enormous files. Jpegs in particular are designed for phởtographs not statistical graphics. Use readable fonts. For graphics I prefer sans-serif fonts such as Helvetica or Arial. Make sure the font size is readable after the figure is scaled to whatever size it will be printed. Avoid cluttered legends. Where possible, add labels directly to the elements of the plot rather than use a legend at all. If this won’t work, then keep the legend from obscuring the plotted data,
(More)…


