I freshly installed R and the IRkernel to run R in a jupyter notebook, following the instruction on the README. The issue I have is that, for some reason, in a notebook when I plot something, adding expressions to use latex in the title or in the axis labels, the greek letters won't render. Here is the simple code I'm running:
rho <- function(h, q){
if (-2*q <= h & h <= 2*q) {
return(1 - abs(h) / (2*q+1))
}
else {
return(0)
}
}
q = 3
rho <- Vectorize(rho, vectorize.args=c("h"))
plot(0:10, rho(0:10, q),
main=expression(alpha[1] ^ 2 + frac(beta, 3)),
xlab="|h|", ylab=expression(rho(h)),
type='b')
grid()
This is the plot I get.
As you can see the greek letters in the title and in the y-axis label don't show up.
If I run the same exact code in R, in the terminal, the plot pop up in the window and the greek letters show up as they should. Could someone help me with that? I have been searching for similar issues on google, but I wasn't able to find some.
