7.7.6. mclearn.viz.plot_hex_map¶
-
mclearn.viz.
plot_hex_map
(ra, dec, origin=180, title=None, projection='mollweide', gridsize=100, milky_way=True, C=None, reduce_C_function=<function mean at 0x000000000492B840>, vmin=0, vmax=1500, mincnt=1, cmap=<matplotlib.colors.LinearSegmentedColormap object>, axisbg='white', colorbar=True, labels=False, ax=None)[source]¶ Plot the density of objects on a hex map.
Parameters: - ra (array) – The array containing the ra coordinates.
- dec (array) – The array containing the dec coordinates.
- origin (int) – The ra value in the middle of the map.
- title (str) – The title of the plot.
- projection (str) – The projection mode to be used. Default is ‘mollweide’.
- gridsize (int) – The number of hexagons in the x-direction, default is 100. The corresponding number of hexagons in the y-direction is chosen such that the hexagons are approximately regular. Alternatively, gridsize can be a tuple with two elements specifying the number of hexagons in the x-direction and the y-direction.
- milky_way (boolean) – Whether the plane of the Milky Way is plotted. Default is True.
- C (array) – If C is specified, it specifies values at the coordinate (ra[i],dec[i]). These values are accumulated for each hexagonal bin and then reduced according to reduce_C_function, which defaults to numpy’s mean function (np.mean). (If C is specified, it must also be a 1-D sequence of the same length as ra and dec.)
- reduce_C_function (function) – The function to be applied to the C values (or the count values) on each hexagon bin.
- vmin (scalar) – vmin is the value that sits at the bottom end of the colour bar. If None, the min of array C is used.
- vmax (scalar) – vmax is the value that sits at the top end of the colour bar. If None, the max of array C is used.
- mincnt (int) – If not None, only display cells with more than mincnt number of points in the cell.
- cmap (Colormap) – a matplotlib.colors.Colormap instance.
- axisbg (str) – The background colour of the map. Default is ‘white’.
- colorbar (boolean) – Whether to render the color bar (i.e. legend). Default is True.
- labels (boolean) – Whether to render the axis labels. Default to False (to avoid clutter).
- ax (matplotlib Axes) – Returns the Axes object with the hex map drawn onto it.