I have a question. Do I miss something or is spaces not supported in the filenames used when for example renaming files? When using strings with spaces I get the "is not a directory"-error.

I was looking for an alternative to the Matlab function plot to solve this specific problem with lines on top of markers, so thank you! Funny that I found your function via Matlab Fileexchange when you have written the function "inhouse" =)

Seems like you are calculating too small kernel sizes when higher values of sigma are used, e.g., when sigma>10 the kernels are clearly truncated. With sigma>40 your kernel size becomes imaginary.