rstatisticshistogramitalics

Main title and under it a text in italic


I have a question.

I want to add to my histogram, under the main title, another text, but I need this one in Italics, how can I do it? I have this code

hist(DataFile, breaks=50, main="Distribucion de Peso\nUca rapax", ylab="Frecuencia de peso", xlab="Peso \n (en miligramos)", col="blue", border="darkblue")

I know that the code is italic( but I cannot manage where I need to add it.


Solution

  • You could always add it via mtext

    hist(rnorm(200), breaks=50, main="Distribucion de Peso", 
        ylab="Frecuencia de peso", 
        xlab="Peso \n (en miligramos)", 
        col="blue", border="darkblue")
    mtext(expression(italic("Uca rapax")),3,0)
    

    title second line italic