Use superscripts in R axis labels

前端 未结 4 557
南旧
南旧 2020-12-24 00:53

Using base graphics in R, how can I add superscripts to axis labels, as one might want to when plotting latitude and longitude axes on a map.

Consider this example:<

4条回答
  •  难免孤独
    2020-12-24 01:37

    @The Thunder Chimp You can split text in such a way that some sections are affected by super(or sub) script and others aren't through the use of *. For your example, with splitting the word "moment" from "4th" -

    plot(rnorm(30), xlab = expression('4'^th*'moment'))
    

提交回复
热议问题