A sample text widget

Etiam pulvinar consectetur dolor sed malesuada. Ut convallis euismod dolor nec pretium. Nunc ut tristique massa.

Nam sodales mi vitae dolor ullamcorper et vulputate enim accumsan. Morbi orci magna, tincidunt vitae molestie nec, molestie at mi. Nulla nulla lorem, suscipit in posuere in, interdum non magna.

Sustainability of water use in agriculture

AQUASTAT, developed and maintained by the Food and Agriculture Organization of the UN, is the global database that gives quantitative information on water resources and withdrawal of water for different uses.

Agricultural water withdrawal is defined as follows:

Annual quantity of self-supplied water withdrawn for irrigation, livestock and aquaculture purposes. It includes water from primary […]

Millennium development goals: big ideas, broken promises? – interactive | Global development | theguardian.com

Millennium development goals: big ideas, broken promises? – interactive | Global development | theguardian.com.

Very well presented.

Hindi/Devanagari presentations using orgmode, R, latex and beamer

I recently had to prepare a beamer presentation in hindi/devanagari. I usually use emacs-orgmode  with a lot of R source code embedded in it to prepare my beamer presentations. To adapt the entire setup to work with devanagari, this is what I needed to do.


Make orgmode export to latex using xetex rather than […]

Making Data Meaningful

United Nations Economic Commission for Europe has published these two documents very interesting documents.

Making Data Meaningful, Part I

Making Data Meaningful, Part II


Working with ggplot, version 2

In my previous post on this issue, I had presented a code that made weighted boxplots and annotated them with boxplot statistics and the mean values. The problem with that code was that it printed these annotations right on the vertical axes of the boxplots. Also, a relatively minor problem was that, when the values […]

simple.scatterplot: Two way distributions

John Verzani’s book has a title page that shows a scatterplot with histograms of x and y variables along the two axes. It is a very powerful way of looking at two distributions. The plot was generated through a function simple.scatterplot. The function is made available as part of the UsingR package, which can be […]

Graphics (base, grid and lattice) in RNews

R News 2(2) has papers on grid and lattice packages. R News 3(2) has papers on base, grid and gridBase.

Essential stuff for anybody trying to master R graphics


Working with ggplot

Hadley Wickham’s ggplot is a very interesting package. It makes beautiful graphics, integrates well with some of the other packages to allow you to superimpose the plots of various types of estimates on plots of data. In particular, it uses colours very well. The default colour schemes are aesthetically pleasing. It allows a flexible use […]

Page orientation problem in converting postscript files to pdf using ps2pdf

A commonly reported problem with ps2pdf is that it does not always guess the page orientation right.

A neat solution is here http://allendowney.com/essays/orientation/

I just edited the gs_statd.ps to define the wide page and added an alias in my bashrc called widepdf to convert files to pdf in the wide format. It works great now!!


Postscript graphics from R

Graphics made in R are best saved as postscript files if the files are to be used for printing. This can be done by wrapping your commands (for example, plot) in a postscript device, or by printing the plot to postscript after the plot has been created.

Method 1.


plot commands


Superimposing two plots

If you want to give two plot commands, and do not want the second one to wipe out the first one, do the following.


plot(first plot)




plot(second plot)


This will superimpose the second plot on the first. Note that the two plots may have different scales. […]


John Fox’s package, “car”, has a very useful scatterplot.matrix (or simply spm) to make scatterplots of pairs from a set of variables. The plot below was created using

library(“car”) scatterplot.matrix(~Exppop+Exppphc+literacy+Oppphc, reg.line=lm, smooth=TRUE, span=0.5, diagonal = ‘density’, data=temp) dev.print(jpeg, file=”~/graph-matrix.jpg”, width=500, height=500, pointsize=10)