Skip to content

Commit 6df02e2

Browse files
DOC/API colorbar argument: allow int
1 parent ac0b096 commit 6df02e2

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

surfer/viz.py

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1890,10 +1890,10 @@ def save_imageset(self, prefix, views, filetype='png', colorbar='auto',
18901890
desired views for images
18911891
filetype: string
18921892
image type
1893-
colorbar: None | 'auto' | [int], optional
1894-
if None no colorbar is visible. If 'auto' is given the colorbar
1895-
is only shown in the middle view. Otherwise on the listed
1896-
views when a list of int is passed.
1893+
colorbar: 'auto' | int | list of int | None
1894+
For 'auto', the colorbar is shown in the middle view (default).
1895+
For int or list of int, the colorbar is shown in the specified
1896+
views. For ``None``, no colorbar is shown.
18971897
row : int
18981898
row index of the brain to use
18991899
col : int
@@ -1909,6 +1909,8 @@ def save_imageset(self, prefix, views, filetype='png', colorbar='auto',
19091909
"Use show_view & save_image for a single view")
19101910
if colorbar == 'auto':
19111911
colorbar = [len(views) // 2]
1912+
elif isinstance(colorbar, int):
1913+
colorbar = [colorbar]
19121914
images_written = []
19131915
for iview, view in enumerate(views):
19141916
try:
@@ -1960,10 +1962,10 @@ def save_image_sequence(self, time_idx, fname_pattern, use_abs_idx=True,
19601962
applies if ``montage`` is a flat list).
19611963
border_size: int
19621964
Size of image border (more or less space between images).
1963-
colorbar: None | 'auto' | [int], optional
1964-
If None no colorbar is visible. If 'auto' is given the colorbar
1965-
is only shown in the middle view. Otherwise on the listed
1966-
views when a list of int is passed.
1965+
colorbar: 'auto' | int | list of int | None
1966+
For 'auto', the colorbar is shown in the middle view (default).
1967+
For int or list of int, the colorbar is shown in the specified
1968+
views. For ``None``, no colorbar is shown.
19671969
19681970
Returns
19691971
-------
@@ -2009,10 +2011,10 @@ def save_montage(self, filename, order=['lat', 'ven', 'med'],
20092011
applies if ``order`` is a flat list)
20102012
border_size: int
20112013
Size of image border (more or less space between images)
2012-
colorbar: None | 'auto' | [int], optional
2013-
if None no colorbar is visible. If 'auto' is given the colorbar
2014-
is only shown in the middle view. Otherwise on the listed
2015-
views when a list of int is passed.
2014+
colorbar: 'auto' | int | list of int | None
2015+
For 'auto', the colorbar is shown in the middle view (default).
2016+
For int or list of int, the colorbar is shown in the specified
2017+
views. For ``None``, no colorbar is shown.
20162018
row : int
20172019
row index of the brain to use
20182020
col : int
@@ -2042,6 +2044,8 @@ def save_montage(self, filename, order=['lat', 'ven', 'med'],
20422044

20432045
if colorbar == 'auto':
20442046
colorbar = [len(views) // 2]
2047+
elif isinstance(colorbar, int):
2048+
colorbar = [colorbar]
20452049
brain = self.brain_matrix[row, col]
20462050

20472051
# store current view + colorbar visibility
@@ -2096,10 +2100,10 @@ def save_movie(self, fname, tstart=None, tstop=None, step=1,
20962100
applies if ``montage`` is a flat list)
20972101
border_size: int
20982102
Size of image border (more or less space between images)
2099-
colorbar: None | 'auto' | [int], optional
2100-
if None no colorbar is visible. If 'auto' is given the colorbar
2101-
is only shown in the middle view. Otherwise on the listed
2102-
views when a list of int is passed.
2103+
colorbar: 'auto' | int | list of int | None
2104+
For 'auto', the colorbar is shown in the middle view (default).
2105+
For int or list of int, the colorbar is shown in the specified
2106+
views. For ``None``, no colorbar is shown.
21032107
framerate : float
21042108
Framerate of the movie (frames per second).
21052109
codec : str

0 commit comments

Comments
 (0)