MCPcopy Index your code
hub / github.com/danjgale/surfplot / render

Method render

surfplot/plotting.py:365–407  ·  view source on GitHub ↗

Generate surface plot with all provided layers Parameters ---------- offscreen : bool, optional Render offscreen. Default: True Returns ------- brainspace.plotting.base.Plotter Surface plot

(self, offscreen=True)

Source from the content-addressed store, hash-verified

363 self.cbar_labels.append(cbar_label)
364
365 def render(self, offscreen=True):
366 """Generate surface plot with all provided layers
367
368 Parameters
369 ----------
370 offscreen : bool, optional
371 Render offscreen. Default: True
372
373 Returns
374 -------
375 brainspace.plotting.base.Plotter
376 Surface plot
377 """
378 view_layout, hemi_layout = self.plot_layout
379 dims = np.array(view_layout).shape
380
381 if self.flip and len(self.surfaces) == 2:
382 view_layout, hemi_layout = _flip_hemispheres(view_layout,
383 hemi_layout)
384
385 # create plot tuples
386 layers = PTuple(*self.layers)
387 cmaps = PTuple(*self.cmaps)
388 crange = PTuple(*self.color_ranges)
389
390 if all(i != 1 for i in dims) and (len(dims) == 2):
391 # grid layout
392 names = [[layers] * dims[1]] * dims[0]
393 cmap = [cmaps] * dims[1]
394 color_range = [crange] * dims[1]
395 else:
396 # column or row layout
397 names = [layers]
398 cmap = [cmaps]
399 color_range = [crange]
400
401 return plot_surf(surfs=self.surfaces, layout=hemi_layout,
402 array_name=names, cmap=cmap, color_bar=False,
403 color_range=color_range, view=view_layout,
404 background=self.background, zoom=self.zoom,
405 nan_color=(0, 0, 0, 0), share=False,
406 label_text=self.label_text, size=self.size,
407 return_plotter=True, offscreen=offscreen)
408
409 def _add_colorbars(self, location='bottom', label_direction=None,
410 n_ticks=3, decimals=2, fontsize=10, draw_border=True,

Callers 2

buildMethod · 0.95
showMethod · 0.95

Calls 2

_flip_hemispheresFunction · 0.85
plot_surfFunction · 0.85

Tested by

no test coverage detected