| Title: | Galactic and Equatorial Coordinate Implementation for 'ggplot2' |
|---|---|
| Description: | Simple tools to draw sky maps in 'ggplot2' using galactic or equatorial coordinates. Includes custom coordinate systems, grid labels, and helpers for sky map breaks. |
| Authors: | Grigory Uskov [aut, cre, cph] (ORCID: <https://orcid.org/0000-0002-0274-1350>) |
| Maintainer: | Grigory Uskov <[email protected]> |
| License: | MIT + file LICENSE |
| Version: | 0.1.0 |
| Built: | 2026-05-11 09:16:55 UTC |
| Source: | https://github.com/uskovgs/ggsky |
ARTSS1-5 X-ray Source Catalog
artss15artss15
data.frame
Source name.
Right ascension in J2000, degrees.
Declination in J2000, degrees.
Position uncertainty, arcseconds.
Flux in 'erg/cm^2/s'.
Flux uncertainty in 'erg/cm^2/s'.
Cross-identification name.
Source type.
Redshift.
Galactic longitude, degrees.
Galactic latitude, degrees.
https://cdsarc.cds.unistra.fr/viz-bin/cat/J/A+A/687/A183 (bibcode: 2024A&A...687A.183S)
Coordinate system for sky maps in equatorial coordinates using a Hammer-Aitoff projection.
coord_equatorial( clip = "on", label_offset_lon = 0.025, label_offset_lat = 0.035, munch_deg = 1, pad_top_pt = NULL, pad_bottom_pt = NULL, pad_left_pt = NULL, pad_right_pt = NULL, clip_on_boundaries = TRUE )coord_equatorial( clip = "on", label_offset_lon = 0.025, label_offset_lat = 0.035, munch_deg = 1, pad_top_pt = NULL, pad_bottom_pt = NULL, pad_left_pt = NULL, pad_right_pt = NULL, clip_on_boundaries = TRUE )
clip |
Character scalar. Passed to 'ggplot2' coordinate clipping ('"on"' or '"off"'). |
label_offset_lon |
Numeric scalar in npc units. Vertical offset for right-ascension labels relative to the equator. |
label_offset_lat |
Numeric scalar in npc units. Outward offset for declination labels relative to the projection outline. |
munch_deg |
Numeric scalar. Maximum angular step (in degrees) used to segment paths and polygon edges along great circles before projection. |
pad_top_pt, pad_bottom_pt, pad_left_pt, pad_right_pt
|
Optional numeric scalars (points) used to reserve external space for axis text. 'NULL' enables automatic sizing. |
clip_on_boundaries |
Logical scalar. If 'TRUE', draws an outside mask so geoms are visually clipped to the projection boundary. |
A 'ggplot2' coordinate object (a 'ggproto' instance inheriting from 'CoordEquatorial') to be added to a plot.
library(ggplot2) df <- data.frame( ra = c(0, 30, 60, 90, 120), dec = c(-20, -5, 10, 25, 15) ) ggplot(df, aes(ra, dec)) + geom_path() + coord_equatorial() + scale_eq_ra(breaks = seq(0, 330, by = 30)) + scale_eq_dec(breaks = seq(-60, 60, by = 30))library(ggplot2) df <- data.frame( ra = c(0, 30, 60, 90, 120), dec = c(-20, -5, 10, 25, 15) ) ggplot(df, aes(ra, dec)) + geom_path() + coord_equatorial() + scale_eq_ra(breaks = seq(0, 330, by = 30)) + scale_eq_dec(breaks = seq(-60, 60, by = 30))
Coordinate system for sky maps in galactic coordinates using a Hammer-Aitoff projection.
coord_galactic( clip = "on", label_offset_lon = 0.025, label_offset_lat = 0.035, munch_deg = 1, pad_top_pt = NULL, pad_bottom_pt = NULL, pad_left_pt = NULL, pad_right_pt = NULL, clip_on_boundaries = TRUE )coord_galactic( clip = "on", label_offset_lon = 0.025, label_offset_lat = 0.035, munch_deg = 1, pad_top_pt = NULL, pad_bottom_pt = NULL, pad_left_pt = NULL, pad_right_pt = NULL, clip_on_boundaries = TRUE )
clip |
Character scalar. Passed to 'ggplot2' coordinate clipping ('"on"' or '"off"'). |
label_offset_lon |
Numeric scalar in npc units. Vertical offset for galactic-longitude labels relative to the equator. |
label_offset_lat |
Numeric scalar in npc units. Outward offset for galactic-latitude labels relative to the projection outline. |
munch_deg |
Numeric scalar. Maximum angular step (in degrees) used to segment paths and polygon edges along great circles before projection. |
pad_top_pt, pad_bottom_pt, pad_left_pt, pad_right_pt
|
Optional numeric scalars (points) used to reserve external space for axis text. 'NULL' enables automatic sizing. |
clip_on_boundaries |
Logical scalar. If 'TRUE', draws an outside mask so geoms are visually clipped to the projection boundary. |
A 'ggplot2' coordinate object (a 'ggproto' instance inheriting from 'CoordGalactic') to be added to a plot.
library(ggplot2) df <- data.frame( lon = c(0, 30, 60, 90, 120), lat = c(-20, -5, 10, 25, 15) ) ggplot(df, aes(lon, lat)) + geom_path() + coord_galactic() + scale_gal_lon(breaks = seq(0, 330, by = 30)) + scale_gal_lat(breaks = seq(-60, 60, by = 30))library(ggplot2) df <- data.frame( lon = c(0, 30, 60, 90, 120), lat = c(-20, -5, 10, 25, 15) ) ggplot(df, aes(lon, lat)) + geom_path() + coord_galactic() + scale_gal_lon(breaks = seq(0, 330, by = 30)) + scale_gal_lat(breaks = seq(-60, 60, by = 30))
Celestial equator is the great circle with declination equal to 0 deg.
equatorequator
data.frame
Galactic longitude, degrees.
Galactic latitude, degrees.
Right ascension, degrees.
https://en.wikipedia.org/wiki/Celestial_equator
Equatorial declination scale settings
scale_eq_dec(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())scale_eq_dec(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())
breaks, minor_breaks
|
Break specification passed to 'coord_equatorial()'. |
An object consumed by 'ggplot_add()'.
Equatorial right-ascension scale settings
scale_eq_ra(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())scale_eq_ra(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())
breaks, minor_breaks
|
Break specification passed to 'coord_equatorial()'. |
An object consumed by 'ggplot_add()'.
Galactic latitude scale settings
scale_gal_lat(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())scale_gal_lat(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())
breaks, minor_breaks
|
Break specification passed to 'coord_galactic()'. |
An object consumed by 'ggplot_add()'.
Galactic longitude scale settings
scale_gal_lon(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())scale_gal_lon(breaks = ggplot2::waiver(), minor_breaks = ggplot2::waiver())
breaks, minor_breaks
|
Break specification passed to 'coord_galactic()'. |
An object consumed by 'ggplot_add()'.