function [labels,yy] = setYLabels(gca,nrInt,maxy,miny)

yy = get(gca,'ylim');
if yy(1) > 0
    step = yy(end)/double(nrInt);
    yy=0.0:yy(end)/double(nrInt):yy(end);
elseif yy(end) < 0
    step = -yy(end)/double(nrInt);
    yy=-yy(end):-yy(end)/double(nrInt):0.0;
else
    step = (yy(end)-yy(1))/double(nrInt);
    yya(1) = 0.0;
    n = 1;
    while true
        new = yya(n) + step;
        if new < maxy
            n = n + 1;
            yya(n) = new;
        else
            n = n + 1;
            yya(n) = new;
            break
        end
    end
    new = 0.0;
    while true
        new = new - step;
        if new > miny
            n = n + 1;
            yya(n) = new;
        else
            n = n + 1;
            yya(n) = new;
            break
        end
    end
end
yy=unique(yya);
labels={};
for n = 1 : length(yy)
    label     = num2str(yy(n));
    if length(label) > 3
        l1 = length(label) + 1;
        l2 = length(label) + 3;
        labels{n} = [];
        while true
            l1 = l1 - 3;
            l2 = l2 - 3;
            if l1 <= 1
                labels{n} = [label(1:l2) labels{n}];
                break
            else
                c = str2num(label(l1 -1));
                if ~isempty(c)
                    labels{n} = ['.' label(l1:l2) labels{n}];
                else
                    labels{n} = [label(1:l2) labels{n}];
                    break
                end
            end
        end
    else
        labels{n} = label;
    end
end

