healpy.newvisufunc.projview(m=None, fig=None, rot=None, coord=None, unit='', xsize=1000, width=None, nest=False, min=None, max=None, flip='astro', format='%g', cbar=True, cmap='viridis', norm=None, norm_dict=None, graticule=False, graticule_labels=False, rot_graticule=False, graticule_coord=None, override_rot_graticule_properties=None, return_only_data=False, projection_type='mollweide', cb_orientation='horizontal', xlabel=None, ylabel=None, longitude_grid_spacing=60, latitude_grid_spacing=30, override_plot_properties=None, title=None, rlabel=None, llabel=None, xtick_label_color='black', ytick_label_color='black', graticule_color=None, fontname=None, fontsize=None, phi_convention='counterclockwise', custom_xtick_labels=None, custom_ytick_labels=None, cbar_ticks=None, show_tickmarkers=False, extend=None, invRot=True, sub=111, reuse_axes=False, margins=None, hold=False, remove_dip=False, remove_mono=False, gal_cut=0, **kwargs)

Plot a healpix map (given as an array) in the chosen projection.

See examples of using this function in the documentation under “Other tutorials”. Overplot points or lines using newprojplot().


this function is work in progress, the aim is to reimplement the healpy plot functions using the new features of matplotlib and remove most of the custom projection code. Please report bugs or submit feature requests via Github. The interface will change in future releases.

mfloat, array-like or None

An array containing the map, supports masked maps, see the ma function. If None, will display a blank map, useful for overplotting.

figint or None, optional

The figure number to use. Default: create a new figure

rotscalar or sequence, optional

Describe the rotation to apply. In the form (lon, lat, psi) (unit: degrees) : the point at longitude lon and latitude lat will be at the center. An additional rotation of angle psi around this direction is applied.

coordsequence of character, optional

Either one of ‘G’, ‘E’ or ‘C’ to describe the coordinate system of the map, or a sequence of 2 of these to rotate the map from the first to the second coordinate system. default: ‘G’

unitstr, optional

A text describing the unit of the data. Default: ‘’

xsizeint, optional

The size of the image. Default: 800

widthfloat, optional

Sets the width of the figure. Use override_plot_properties for more. Overrides the default width of the figure

nestbool, optional

If True, ordering scheme is NESTED. Default: False (RING)

minfloat, optional

The minimum range value

maxfloat, optional

The maximum range value

flip{‘astro’, ‘geo’}, optional

Defines the convention of projection : ‘astro’ (default, east towards left, west towards right) or ‘geo’ (east towards roght, west towards left) It creates the healpy_flip attribute on the Axes to save the convention in the figure.

formatstr, optional

The format of the scale label. Default: ‘%g’

cbarbool, optional

Display the colorbar. Default: True

cmapstr, optional

Specify the colormap. default: Viridis

norm{‘hist’, ‘log’, ‘symlog’, ‘symlog2’, None}

Color normalization: hist = histogram equalized color mapping. log = logarithmic color mapping. symlog = symmetric logarithmic, linear between -linthresh and linthresh. symlog2 = similar to symlog, used for plack log colormap. default: None (linear color mapping)

norm_dictdict, optional

Parameters for normalization: default is set to {“linthresh”: 1, “base”: 10, “linscale”: 0.1} where linthresh determines the linear regime of symlog norm, and linscale sets the size of the linear regime on the cbar. default: None


add graticule


longitude and latitude labels


rotate also the graticule when rotating the map


Either one of ‘G’, ‘E’ or ‘C’ to describe the coordinate system of the graticule


Override the following rotated graticule properties: “g_linestyle”, “g_linewidth”, “g_color”, “g_alpha”, “t_step”, “p_step”.

return_only_databool, optional

Return array of data

projection_type{‘aitoff’, ‘hammer’, ‘lambert’, ‘mollweide’, ‘cart’,
‘3d’, ‘polar’}

type of the plot

cb_orientation{‘horizontal’, ‘vertical’}

color bar orientation


set x axis label


set y axis label


set x axis grid spacing


set y axis grid spacing


Override the following plot properties: “cbar_shrink”, “cbar_pad”, “cbar_label_pad”, “cbar_tick_direction”, “vertical_tick_rotation” “figure_width”: width, “figure_size_ratio”: ratio.


set title of the plot


set label at top right corner of axis


set label at top left corner of axis


Change the color of the graticule xticks


Change the color of the graticule yticks


Change the color of the graticule


Change the fontname of the text

fontsize: dict

Override fontsize of labels: “xlabel”, “ylabel”, “title”, “xtick_label”, “ytick_label”, “cbar_label”, “cbar_tick_label”.


convention on x-axis (phi), ‘counterclockwise’ (default), ‘clockwise’, ‘symmetrical’ (phi as it is truly given) if flip is “geo”, phi_convention should be set to ‘clockwise’.


override x-axis tick labels


override y-axis tick labels


custom ticks on the colorbar

show_tickmarkersbool, optional

Preserve tickmarkers for the full bar with labels specified by ticks default: None

extendstr, optional

Whether to extend the colorbar to mark where min or max tick is less than the min or max of the data. Options are “min”, “max”, “neither”, or “both”


invert rotation

subint, scalar or sequence, optional

Use only a zone of the current figure (same syntax as subplot). Default: 111

reuse_axesbool, optional

If True, reuse the current Axes (should be a MollweideAxes). This is useful if you want to overplot with a partially transparent colormap, such as for plotting a line integral convolution. Default: False

marginsNone or sequence, optional

Either None, or a sequence (left,bottom,right,top) giving the margins on left,bottom,right and top of the axes. Values are relative to figure (0-1). Default: None

holdbool, optional

If True, replace the current Axes by new axis. use this if you want to have multiple maps on the same figure. Default: False

remove_dipbool, optional

If True, remove the dipole+monopole

remove_monobool, optional

If True, remove the monopole

gal_cutfloat, scalar, optional

Symmetric galactic cut for the dipole/monopole fit. Removes points in latitude range [-gal_cut, +gal_cut]


any leftover arguments will be passed to pcolormesh