Skip to content

Commit 70fd8c3

Browse files
committed
[REF] views_size replaces figsize
-Inspired by zhen-Qi's suggestion, I replaced the figsize parameter of plot_point_brain() with the views_size parameter. This new parameter specifies the size of one single view of the brain. The total figure size will be adjusted based on the number of views that the user wants and the orientation of these views. -Added matplotlib >= 3.3.0 in requirements.txt
1 parent 18fab34 commit 70fd8c3

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

netneurotools/plotting.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ def plot_fsvertex(data, *, order='lr', surf='pial', views='lat',
726726

727727

728728
def plot_point_brain(data, coords, views=None, views_orientation='vertical',
729-
cbar=False, figsize=(4, 4.8), robust=True, size=50,
729+
views_size=(4, 2.4), cbar=False, robust=True, size=50,
730730
**kwargs):
731731
"""
732732
Plots `data` as a cloud of points in 3D space based on specified `coords`
@@ -744,10 +744,10 @@ def plot_point_brain(data, coords, views=None, views_orientation='vertical',
744744
views_orientation: str, optional
745745
Orientation of the views. Can be either 'vertical' or 'horizontal'.
746746
Default: 'vertical'.
747+
views_size : tuple, optional
748+
Figure size of each view. Default: (4, 2.4)
747749
cbar : bool, optional
748750
Whether to also show colorbar. Default: False
749-
figsize : tuple, optional
750-
Figure size. Default: (4, 4.8)
751751
robust : bool, optional
752752
Whether to use robust calculation of `vmin` and `vmax` for color scale.
753753
size : int, optional
@@ -777,6 +777,7 @@ def plot_point_brain(data, coords, views=None, views_orientation='vertical',
777777
ncols, nrows = 1, len(views)
778778
elif views_orientation == 'horizontal':
779779
ncols, nrows = len(views), 1
780+
figsize = (ncols * views_size[0], nrows * views_size[1])
780781

781782
# create figure and axes (3d projections)
782783
fig, axes = plt.subplots(ncols=ncols, nrows=nrows,

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ nilearn
55
numpy>=1.16
66
scikit-learn
77
scipy>=1.4.0
8+
matplotlib >=3.3.0
89
tqdm

0 commit comments

Comments
 (0)