# Superscript out of bound and alpha symbol in Rplotly

Hi,
I am trying to insert the sigma symbol along with superscript in the title of plotly.
I tried the following code. I am trying to get the superscript inside the boundary.

Thanks

library(plotly)
plot_ly(airquality, x = ~Wind, y = ~Temp,
type = 'scatter', mode = 'markers') %>%
layout(title="&sigma<sup>2</sup>")


Have you tried "\sigma[2]"?

More maths symbols can be found here

According to the Carson Sievert's book, this should be possible by wrapping in the TeX() function:

layout(title=TeX("\\sigma_2"))

1 Like

Thanks, @MyKo101, I have done with

layout(title =TeX("\\sigma^{2}"))


This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.

that doesn't work either.
Thanks though