Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert breaking behavior in plot_glass_brain #3924

Merged
merged 4 commits into from
Aug 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 0 additions & 2 deletions nilearn/plotting/img_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -1079,14 +1079,12 @@ def plot_glass_brain(stat_map_img,
if plot_abs:
cbar_vmin, cbar_vmax, vmin, vmax = _get_colorbar_and_data_ranges(
_safe_get_data(stat_map_img, ensure_finite=True),
vmin=vmin,
vmax=vmax,
symmetric_cbar=symmetric_cbar,
force_min_stat_map_value=0)
else:
cbar_vmin, cbar_vmax, vmin, vmax = _get_colorbar_and_data_ranges(
_safe_get_data(stat_map_img, ensure_finite=True),
vmin=vmin,
vmax=vmax,
symmetric_cbar=symmetric_cbar)
else:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,8 @@ def test_plot_glass_brain_with_completely_masked_img(display_mode):
img = Nifti1Image(np.zeros((10, 20, 30)), np.eye(4))
plot_glass_brain(img, display_mode=display_mode)
plt.close()


def test_plot_glass_brain_vmin_vmax(mni_3d_img):
"""Smoke tests for plot_glass_brain being passed vmin and vmax."""
plot_glass_brain(mni_3d_img, vmin=-2, vmax=2)