MCPcopy Create free account
hub / github.com/danjgale/surfplot / _flip_hemispheres

Function _flip_hemispheres

surfplot/plotting.py:78–101  ·  view source on GitHub ↗

Flip left and right hemispheres in the horizontal dimension Parameters ---------- v : list View layout list h : list Hemisphere layout list Returns ------- list, list Flipped view and hemisphere layouts

(v, h)

Source from the content-addressed store, hash-verified

76
77
78def _flip_hemispheres(v, h):
79 """Flip left and right hemispheres in the horizontal dimension
80
81 Parameters
82 ----------
83 v : list
84 View layout list
85 h : list
86 Hemisphere layout list
87
88 Returns
89 -------
90 list, list
91 Flipped view and hemisphere layouts
92 """
93 v = np.array(v)
94 h = np.array(h)
95 if (v.ndim == 1) and (v.shape[0] > 1):
96 # flip row
97 flip_axis = 0
98 elif (v.ndim == 2) and (v.shape[1] > 1):
99 # flip grid
100 flip_axis = 1
101 return np.flip(v, flip_axis).tolist(), np.flip(h, flip_axis).tolist()
102
103
104def _check_data(data):

Callers 1

renderMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected