Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Vasudevan, Rama K
pycroscopy
Commits
8a2cf7db
Commit
8a2cf7db
authored
Sep 01, 2017
by
Rama Vasudevan
Browse files
Added feature to plot_map_stack to add colorbar label
Users can now specify colorbar label in plot_map_stack function
parent
f4a90d0a
Changes
1
Hide whitespace changes
Inline
Side-by-side
pycroscopy/viz/plot_utils.py
View file @
8a2cf7db
...
...
@@ -693,7 +693,7 @@ def plotScree(scree, title='Scree'):
def
plot_map_stack
(
map_stack
,
num_comps
=
9
,
stdevs
=
2
,
color_bar_mode
=
None
,
evenly_spaced
=
False
,
reverse_dims
=
True
,
title
=
'Component'
,
heading
=
'Map Stack'
,
fig_mult
=
(
4
,
4
),
pad_mult
=
(
0.1
,
0.07
),
**
kwargs
):
title
=
'Component'
,
heading
=
'Map Stack'
,
colorbar_label
=
''
,
fig_mult
=
(
4
,
4
),
pad_mult
=
(
0.1
,
0.07
),
**
kwargs
):
"""
Plots the provided stack of maps
...
...
@@ -717,6 +717,8 @@ def plot_map_stack(map_stack, num_comps=9, stdevs=2, color_bar_mode=None, evenly
if a list of strings (equal to the number of components) are provided, these are used instead.
heading : String
###Insert description here### Default 'Map Stack'
colorbar_label : String
label for colorbar. Default is an empty string.
fig_mult : length 2 array_like of uints
Size multipliers for the figure. Figure size is calculated as (num_rows*`fig_mult[0]`, num_cols*`fig_mult[1]`).
Default (4, 4)
...
...
@@ -807,11 +809,11 @@ def plot_map_stack(map_stack, num_comps=9, stdevs=2, color_bar_mode=None, evenly
stdevs
=
stdevs
,
**
kwargs
)
axes202
[
count
].
set_title
(
subtitle
)
if
color_bar_mode
is
'each'
:
axes202
.
cbar_axes
[
count
].
colorbar
(
im
)
cb
=
axes202
.
cbar_axes
[
count
].
colorbar
(
im
)
cb
.
set_label_text
(
colorbar_label
)
if
color_bar_mode
is
'single'
:
axes202
.
cbar_axes
[
0
].
colorbar
(
im
)
cb
=
axes202
.
cbar_axes
[
0
].
colorbar
(
im
)
cb
.
set_label_text
(
colorbar_label
)
return
fig202
,
axes202
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment