Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7949931
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T02:06:47+00:00 2026-06-04T02:06:47+00:00

Using base graphics in R, how can I add superscripts to axis labels, as

  • 0

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:

plot(-100:-50, 50:100, type="n", xlab="", ylab="", axes=FALSE)
axis(1, seq(-100, -50, 10), labels=paste(abs(seq(-100, -50, 10)), "o", "W", sep=""))
axis(2, seq(50, 100, 10), labels=paste(seq(50,100,10), "o", "N", sep=""))
box()

Produces a nice frame around a map. It would be even nicer to make the degree symbol superscript.

This can usually be done in other plotting functions such as mtext() and text() using expression(paste(...)) or substitute() but how to do it in this case?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T02:06:49+00:00Added an answer on June 4, 2026 at 2:06 am

    It works the same way for axes: parse(text='70^o*N') will raise the o as a superscript (the *N is to make sure the N doesn’t get raised too).

    labelsX=parse(text=paste(abs(seq(-100, -50, 10)), "^o ", "*W", sep=""))
    labelsY=parse(text=paste(seq(50,100,10), "^o ", "*N", sep=""))
    plot(-100:-50, 50:100, type="n", xlab="", ylab="", axes=FALSE)
    axis(1, seq(-100, -50, 10), labels=labelsX)
    axis(2, seq(50, 100, 10), labels=labelsY)
    box()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to insert values in my data base using timer i started with
I started using Base.js for a class inheritance. In Base.js a class should be
A bit of background first: I am using base code from a remote SVN
I am using form base authentication in my Sharepoint site. On my login page
We are using a base class where we set the background picture. That code
I have a small code base using Subsonic 2.1 in my project. I would
when accessing foo() of base using derived class's object. #include <iostream> class base {
In CodeIgniter I'm using a base CRUD My_model , but I have this small
For my tests I'm using a base class MyTestBase defining a method setup() that
i need to update some entry in my data base using jdo in java

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.