Solution of "Could not Find any X11 fonts, check that Font path is correct" while working with "R-statistics" and "Python-rpy2" on MAC LION 10.7.2

Posted on Mon 13 February 2012 in General

Such kind of error i got while i want to get some graphics using python and rpy on Mac LION 10.7.2.
After some google i got the solution, but that search was very tedious, so i decided to simplified the whole procedure. Below is the solution for that.

First check where our problem is located. When you give command like 'xeyes" in your terminal, it open eyes, that means X11 is there.
Now in your "R" GUI or from your terminal interface give sample task, it can be "plot(1,1)".
Here i can see the same error which i am getting in python intrepretor,
its
"Could not find any X11 fonts
check that Font path is correct"

Then in your R, given another command like "sessionInfo()".
You can see both of above command in pic given below.

In "sessionInfo()" you can see that in "Local" fonts are mentioned but this list in incomplete.

So here we got the troubled part and by fixing this point our problem is solved.

For that open "etc/bashrc" and add the following lines which is mentioned below the lineĀ "Setting for the new UTF-8 terminal support in Lion" as in pic below.
These two lines are:
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8

Save the changes, and restart it!

After new logging, give "sessionInfo()" command in your R, You can see in missing fontsĀ are there, and for simple ploting of "plot(1,1)" gives desired output.