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 7967811
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:58:50+00:00 2026-06-04T06:58:50+00:00

I am trying to plot celestial object on the sky (basically with coordinates equivalent

  • 0

I am trying to plot celestial object on the sky (basically with coordinates equivalent to latitude/longitude). I successfully plotted all my points using the "aitoff" projection of the coord_map function, but in this case, the grid is badly displayed, i.e. residual horizontal lines are still displayed for latitudes non equal to zero along with their correct projections.

enter image description here

How could I remove these lines?

Here is code that reproduces the behavior:

library(ggplot2)
library(mapproj)
sky2 = data.frame(RA=0, Dec=0)
skyplot2 <- qplot(RA,Dec,data=sky2,xlim=c(0,360),ylim=c(-89.999,89.999),
xlab="R.A.(°)", ylab="Decl. (°)",main="Source repartition on the sky")
skyplot2 + coord_map(projection="aitoff",orientation=c(89.999,180,0)) + 
scale_y_continuous(breaks=(-2:2)*30,limits=c(-89.999,89.999)) + 
scale_x_continuous(breaks=(0:8)*45,limits=c(0,360),
                   labels=c("","","","","","","","",""))
  • 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-04T06:58:51+00:00Added an answer on June 4, 2026 at 6:58 am

    Definitely this is a bug in ggplot2 so could you please file this bug?
    https://github.com/hadley/ggplot2/issues?state=open
    Filed as a bug.

    Here is a quick and dirty hack.

    f <- function(x, y, ...) {
        if (any(is.na(x))) {
        id <- rle(!is.na(x))$length
        id <- rep(seq_along(id), id)
        df <- data.frame(x, y, id)
        df <- df[order(df$id, df$x), ]
      } else if (any(is.na(y))) {
        id <- rle(!is.na(y))$length
        id <- rep(seq_along(id), id)
        df <- data.frame(x, y, id)
      }
      polylineGrob(df$x, df$y, id = df$id, gp = gpar(col = "white"))
    }
    
    skyplot2 <- qplot(RA,Dec,data=sky2,xlim=c(0,360),ylim=c(-89.999,89.999),
                      xlab="R.A.(°)", ylab="Decl. (°)",main="Source repartition on the sky")
    skyplot2 + coord_map(projection="aitoff",orientation=c(89.999,180,0)) + 
      scale_y_continuous(breaks=(-2:2)*30,limits=c(-89.999,89.999)) + 
      scale_x_continuous(breaks=(0:8)*45,limits=c(0,360),
                         labels=c("","","","","","","","","")) +
                        opts(panel.grid.major = f)
    

    enter image description here

    Note that this may work only with the aitoff projection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to plot large amounts of points using some library. The points
I have a bunch of points that I am trying to plot using matplotlib.
I am trying to plot arrowheads on the lines between two geospatial points (latitude,
I am trying to plot few points dynamically on my Custom View using Quartz
I am trying plot data sets consisting of 3 coordinates: X-coordinate, x-coordinate and the
So I'm trying to plot 2 different arrays of the same dimensions using python's
I'm trying to plot some data into a histogram using pyplot.hist as such: hst
I'm trying to plot heatmap in ggplot2 using csv data following casbon's solution in
When trying to plot a normal PDF with mean=0 and standard deviation=20 using the
I am trying to plot two data series in an MSChart. I am using

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.