c55c07ac94dcaff834f940d8a3a4df372f354121,nilearn/plotting/img_plotting.py,,_crop_colorbar,#,208
Before Change
cbar_vmin = cbar_tick_locs.min()
new_tick_locs = np.linspace(cbar_vmin, cbar_vmax,
len(cbar_tick_locs))
cbar.ax.set_ylim(cbar.norm(cbar_vmin), cbar.norm(cbar_vmax))
outline = cbar.outline.get_xy()
outline[:2, 1] += cbar.norm(cbar_vmin)
outline[2:6, 1] -= (1. - cbar.norm(cbar_vmax))
outline[6:, 1] += cbar.norm(cbar_vmin)
After Change
// matplotlib >= 3.2.0 no longer normalizes axes between 0 and 1
// See https://matplotlib.org/3.2.1/api/prev_api_changes/api_changes_3.2.0.html
if LooseVersion(matplotlib.__version__) >= LooseVersion("3.2.0"):
cbar.ax.set_ylim(cbar_vmin, cbar_vmax)
X, _ = cbar._mesh()
new_X = np.array([X[0], X[-1]])
new_Y = np.array([[cbar_vmin, cbar_vmin], [cbar_vmax, cbar_vmax]])
xy = cbar._outline(new_X, new_Y)
cbar.outline.set_xy(xy)
else:
cbar.ax.set_ylim(cbar.norm(cbar_vmin), cbar.norm(cbar_vmax))
outline = cbar.outline.get_xy()
outline[:2, 1] += cbar.norm(cbar_vmin)
outline[2:6, 1] -= (1. - cbar.norm(cbar_vmax))
outline[6:, 1] += cbar.norm(cbar_vmin)
cbar.outline.set_xy(outline)
cbar.set_ticks(new_tick_locs, update_ticks=True)
def plot_img(img, cut_coords=None, output_file=None, display_mode="ortho",
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 3
Instances
Project Name: nilearn/nilearn
Commit Name: c55c07ac94dcaff834f940d8a3a4df372f354121
Time: 2020-05-02
Author: ari.e.kahn@gmail.com
File Name: nilearn/plotting/img_plotting.py
Class Name:
Method Name: _crop_colorbar
Project Name: arviz-devs/arviz
Commit Name: 63838200064baa7d755735319854e5dbaa919bcd
Time: 2020-04-06
Author: aloctavodia@gmail.com
File Name: arviz/plots/backends/matplotlib/traceplot.py
Class Name:
Method Name: plot_trace