ilarinieminen / SOM-Toolbox

GNU General Public License v2.0
120 stars 57 forks source link

Fix for a colorbar handle bug in recent (>R2014B) versions of MATLAB #12

Closed agvallejo closed 8 years ago

agvallejo commented 8 years ago

The bug prevents the use of som_demo2 onwards, as they all make use of colorbar hiding. Recent versions of MATLAB changed the way they interpret colorbars and no longer accept 'doubles'. This fix creates it anyway and makes it invisible.

tvatanen commented 8 years ago

Thank you for your pull request. Is this fix backwards compatible? Does it work with older versions of matlab?

agvallejo commented 8 years ago

Hi, I tried it this morning in MATLAB 2013 and (un)surprisingly it doesn't work. I've made a little adjustment so that it 'should' work on any version, but I don't have an older MATLAB version to test it ATM. As soon as I check it out I'll commit the proper fix.

agvallejo commented 8 years ago

Done and tested in MATLAB 2013b and 2015a. It should work as far as 2011b (due to the use of narginchk, but that limitation was already there). The backwards compatible patch is hacky and far from pretty, but it works. I commented it well so that it can be cleaned up in the future.

Decent code vs decent compatibility, that eternal paradox.

agvallejo commented 8 years ago

This should take care of issues/bug reports #2 and #11 , by the way