Skip to content

Latest commit

 

History

History
66 lines (40 loc) · 1.81 KB

plot-colorbar.rst

File metadata and controls

66 lines (40 loc) · 1.81 KB

Introduction

:mod:`marvin.utils.plot.colorbar` cooontains utility functions for making colorbars for Marvin maps. These functions are mostly for internal use, however, the :func:`~marvin.utils.plot.colorbar.linearlab` function returns the linearlab colormap, whose properties are described here.

Getting Started

Get the linearlab colormap that is the default for many MaNGA maps:

import marvin.utils.plot.colorbar as colorbar
linearlab, linearlab_r = colorbar.linearlab()
.. plot::
    :align: center
    :include-source: False

    import marvin.utils.plot.colorbar as colorbar
    linearlab, linearlab_r = colorbar.linearlab()

    import matplotlib.pyplot as plt
    fig, axes = plt.subplots(nrows=2, figsize=(6, 1))
    fig.subplots_adjust(top=0.95, bottom=0.01, left=0.25, right=0.99)
    gradient = np.array([np.linspace(0, 1, 256)])

    for ax, cmap in zip(axes, (linearlab, linearlab_r)):
        ax.imshow(gradient, aspect='auto', cmap=cmap)
        pos = list(ax.get_position().bounds)
        y_text = pos[1] + pos[3] / 2.
        fig.text(0.02, y_text, cmap.name, va='center', ha='left', fontsize=16)
        ax.set_axis_off()


Reference/API

Module

.. autosummary:: marvin.utils.plot.colorbar

Functions

.. autosummary::

    marvin.utils.plot.colorbar.linearlab