pycroscopy / sidpy

Python utilities for storing, processing, and visualizing spectroscopic and imaging data
https://pycroscopy.github.io/sidpy/
MIT License
11 stars 14 forks source link

colorbar implementation warning in plot_utils due to depreciation of Matplotlib #78

Closed smisra87 closed 3 years ago

smisra87 commented 4 years ago

Runing the following code snippet throws a warning: Code snippet: fig, axes = sidpy.plot_utils.plot_map_stack(raw_data_3d, reverse_dims=True, pad_mult=(0.15, 0.15), title='Spatial maps of current at different bias', stdevs=2, color_bar_mode='single', num_ticks=3, x_vec=x_vec, y_vec=y_vec, evenly_spaced=True, fig_mult=(3, 3), title_yoffset=0.95)

Warning: MatplotlibDeprecationWarning: Since 3.2, mpl_toolkits's own colorbar implementation is deprecated; it will be removed two minor releases later. Set the 'mpl_toolkits.legacy_colorbar' rcParam to False to use Matplotlib's default colorbar implementation and suppress this deprecation warning. cb = axes.cbar_axes[0].colorbar(im)

ramav87 commented 3 years ago

Have gone through and set the rcParam to False as suggested. Available on rama_dev. This seems to suppress warnings, but the attribute to change in rcParams is only available for matplotlib versions higher than 3.0.3. However, later versions of matplotlib require python >3.5. Hence, this solution means that tests do not pass in Travis for the python 3.5 VM. For now, we will not merge this to master, but when python 3.5 support is dropped, we will merge into master.