Skip to content

Commit

Permalink
Merge 34f8b8d into 1497c07
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiangxuejian committed Sep 3, 2020
2 parents 1497c07 + 34f8b8d commit f5c81ff
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions spectral_cube/spectral_cube.py
Expand Up @@ -3299,6 +3299,7 @@ def plot_channel_maps(self, nx, ny, channels, contourkwargs={}, output_file=None
fig=None, fig_smallest_dim_inches=8, decimals=3, zoom=1,
textcolor=None, cmap='gray_r', tighten=False,
textxloc=0.5, textyloc=0.9,
colorbar=False, colorbar_title='', cax=[0.93, 0.08, 0.02, 0.4],
savefig_kwargs={}, **kwargs):
"""
Make channel maps from a spectral cube
Expand Down Expand Up @@ -3337,6 +3338,13 @@ def plot_channel_maps(self, nx, ny, channels, contourkwargs={}, output_file=None
pointing center will be customizable.
tighten : bool
Call ``plt.tight_layout()`` after plotting?
colorbar : bool
plot a colorbar next the t
colorbar_title : str
title of the colorbar, default is empty.
cax : list
a box controling the position of the colorbar, in the format of
[left, bottom, width, height]. default value = [0.93, 0.08, 0.02, 0.4]
savefig_kwargs : dict
Keyword arguments to pass to ``savefig`` (e.g.,
``bbox_inches='tight'``)
Expand Down Expand Up @@ -3415,6 +3423,12 @@ def plot_channel_maps(self, nx, ny, channels, contourkwargs={}, output_file=None

axis_list.append(ax)

if colorbar:
cax = plt.axes(cax)
fig = plt.gcf()
cbar = fig.colorbar(im, cax=cax)
cbar.ax.set_title(colorbar_title)

if tighten:
plt.tight_layout()

Expand Down

0 comments on commit f5c81ff

Please sign in to comment.