Why does "contourf" run slowly when producing a contour plot of image data in MATLAB R2014b and R2015a? When the provided script ('example_contourf.m') that produces the contour plot of example 960×1280 image data ('f.jpg') is run on MATLAB R2014a and previous releases (i.e. releases with the previous graphics system), the script runs quickly and displays the plot without any significant delay. However, the same script runs slowly when run using MATLAB R2014b and higher. Profiling the script shows that a small amount of time (0.054 seconds) is required to run "contourf" but at least 5-10 seconds are required for the contour plot to be displayed.
Additionally, the script uses the "ginput" function to have the user select two points to define the bottom-left and top-right points of a rectangular sub-image. The mouse motion lags when the script is run in MATLAB R2014b and higher but not on previous releases.
Best Answer