Skip to content

Commit a2fe975

Browse files
ENH Brain time-label: constant size
1 parent 11ce432 commit a2fe975

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

surfer/viz.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -895,8 +895,9 @@ def add_data(self, array, min=None, max=None, thresh=None,
895895
bars.append(bar)
896896
row, col = np.unravel_index(bi, self.brain_matrix.shape)
897897
if array.ndim == 2 and time_label is not None:
898-
self.add_text(0.05, y_txt, time_label(time[0]),
899-
name="time_label", row=row, col=col)
898+
self.add_text(0.95, y_txt, time_label(time[0]),
899+
name="time_label", row=row, col=col,
900+
font_size=14, justification='right')
900901
self._toggle_render(True, views)
901902
data['surfaces'] = surfs
902903
data['colorbars'] = bars
@@ -1385,7 +1386,7 @@ def add_contour_overlay(self, source, min=None, max=None,
13851386
self._toggle_render(True, views)
13861387

13871388
def add_text(self, x, y, text, name, color=None, opacity=1.0,
1388-
row=-1, col=-1):
1389+
row=-1, col=-1, font_size=None, justification=None):
13891390
""" Add a text to the visualization
13901391
13911392
Parameters
@@ -1412,6 +1413,11 @@ def add_text(self, x, y, text, name, color=None, opacity=1.0,
14121413
text = self.brain_matrix[row, col].add_text(x, y, text,
14131414
name, color, opacity)
14141415
self.texts_dict[name] = dict(row=row, col=col, text=text)
1416+
if font_size is not None:
1417+
text.property.font_size = font_size
1418+
text.actor.text_scale_mode = 'viewport'
1419+
if justification is not None:
1420+
text.property.justification = justification
14151421

14161422
def update_text(self, text, name, row=-1, col=-1):
14171423
"""Update text label

0 commit comments

Comments
 (0)