Cone frames#

Cone (“pie wedge”) frames are the classic redshift-survey diagram: an angular sky coordinate opens the wedge, and redshift or distance runs along the radius, with the observer at the apex. Unlike everything else in the package, these are not WCS frames — they’re purpose-built polar wedges with their own tick, label, and plotting machinery (so sky overlays like constellations don’t apply here; the cone has its own helpers).

import skyplothelper as sph
import matplotlib.pyplot as plt

fig = plt.figure(figsize=(7, 5))
ax = sph.make_cone_frame(
    111, angle_center=180, angle_half_width=30,
    r_min=0, r_max=0.15,                      # redshift range
    angle_label="R.A.", fig=fig,
)
sph.cone_scatter(ax, galaxy_ras, galaxy_redshifts, s=3)

Building the wedge#

A redshift cone — a z-RA wedge diagram (light mode) A redshift cone — a z-RA wedge diagram (dark mode)

Redshift cone — code in the Feature Gallery.

make_cone_frame()’s geometry arguments: angle_center= and angle_half_width= set the angular opening (degrees, typically RA), r_min=/r_max= the radial range, and zero_location= / angle_direction= / zero_offset= orient the wedge (where the zero angle sits and which way it increases). The radial coordinate is declared, not just ranged: r_variable= ('redshift' by default, or a distance) with r_unit= and an optional astropy cosmology= for conversions. Label alignment, padding, tick spacing, and grid styling all have dedicated knobs — the defaults are publication-sensible.

Double-sided cones: the bowtie#

A double-sided cone (bowtie) diagram (light mode) A double-sided cone (bowtie) diagram (dark mode)

Bowtie diagram — code in the Feature Gallery.

make_bowtie_frame() builds the two-wedge variant — opposite sky regions sharing a common apex, the classic layout for surveys that span both galactic caps (the CfA “stick man” and its descendants). It returns the two halves, each a normal cone frame that every helper on this page works on independently:

fig = plt.figure(figsize=(7, 7))
ax_top, ax_bot = sph.make_bowtie_frame(
    angle_center=195, angle_half_width=45,
    r_min=0, r_max=0.05, angle_label="R.A.", fig=fig,
)
sph.cone_scatter(ax_top, north_ras, north_zs, s=2)
sph.cone_scatter(ax_bot, south_ras, south_zs, s=2)

orientation= flips the layout between vertical (wedges opening up and down) and horizontal (left and right).

Plotting in the wedge#

  • cone_scatter()cone_scatter(ax, angle, r); the workhorse. cone_scatter_z() color-maps a third quantity.

  • cone_plot() — connected lines (boundaries, tracks).

  • cone_hexbin() / cone_pcolormesh() — density renderings. Hexbin suits scattered galaxy samples (it bins in screen space, so bins stay visually uniform); pcolormesh suits data already gridded in (angle, r).

The radial axis#

The radial direction is where cone plots earn their keep:

  • make_twinr() adds a second radial scale alongside the first, defined by a conversion function — e.g. redshift on one side, comoving Mpc on the other, with redshift_to_r() supplying the cosmology conversion:

    from astropy.cosmology import Planck18
    sph.make_twinr(
        ax,
        convert=lambda z: sph.redshift_to_r(z, r_variable="comoving_distance",
                                            cosmology=Planck18, r_unit="Mpc"),
        r_label="Comoving distance [Mpc]")
    

    (Leaving r_variable='redshift' — the default — returns z unchanged; pass r_variable="comoving_distance" with a cosmology= for an actual distance conversion.)

  • log_r() switches the radial coordinate to a log scale (deep samples with dense low-z foregrounds).

  • add_minor_rticks() adds minor radial ticks; flip_label() and set_label_pad() / get_label_pad() fine-tune label orientation and spacing on the slanted spines.

Pitfalls#

  • Sky helpers don’t work here — cone frames aren’t WCSAxes; no constellation overlays, no get_transform("world"). Use the cone_* plotters.

  • Angles are degrees — pass RA in degrees, not hours, regardless of the angle_label.

  • Hexbin vs. pcolormesh confusion — hexbin bins points (give it the raw catalog); pcolormesh draws an existing 2-D grid. Feeding a catalog to pcolormesh is the most common mix-up.

  • Distance conversions need a cosmologyredshift_to_r and cosmology= accept an astropy cosmology; the conversion extras need scipy (pip install skyplothelper[cone]).

Full listing: API reference.

See also: Frames & projections — for the WCS sky frames that cone frames are contrasted with throughout this page (cone frames are polar wedges, not WCSAxes).

Tutorial: Cone & bowtie plots builds and orients a redshift wedge, plots catalogs as points, tracks, and density, adds the double-sided bowtie, and pairs redshift with comoving distance on a twin radial axis.