Italic text in graphics

A. Blejec — Mar 20, 2014, 10:46 PM

# My consultee wanted to have x-axis labels plotted in italic font.

# You can achieve that using the "font" argument, see help("par")


setwd("D:/_Y/R/STatER/doc")
rezultati <- read.table("../data/rezultati.txt",sep="\t",header=TRUE)

geni<-c("VvINV2","VvACYT","VvADH1","VvAGPL","VvHP","VvETR","VvDMR6","VvLOX","VvOLP","VvSAMT","VvSUSY","VvWRKY","VvAPX","VvGPX","VvGST1","VvGST3","VvCASY","VvCKO","VvGLC1","VvGLC2","VvGLC3","VvLDOX")


# colors
colo=c(rep("white",2),"salmon",rep("white",2),"salmon","white","salmon",rep("white",3),"salmon",rep("white",6),"salmon",rep("white",2))

boxplot(rezultati[,-(1:2)],las=3,col=colo,ylab="p-value",xaxt="n")

#in potem???? Znorela bom, ker je to JA tako enostavno!
# (text above is from my consultee, in Slovenian :)

# use las=2 to rotate the labels and font=3 for italic
axis(1, at =1:22,labels =geni, tick = TRUE,las=2,font=3)

plot of chunk unnamed-chunk-1


# From help("par") for font values:
# 1 corresponds to plain text (the default), 
# 2 to bold face, 
# 3 to italic and 
# 4 to bold italic. 

# Produced by "Compile HTML Notebook from R script"