view logsurf.m @ 1039:a8ee5eca0e6c feature/burgers1d

Allow for the residual normalization function to return a vector. Also change the default normalization from normalizing on norm(u-mean(u),inf) to norm(u/2), since this proved to be better for 1d burgers
author Vidar Stiernström <vidar.stiernstrom@it.uu.se>
date Fri, 18 Jan 2019 09:06:20 +0100
parents ac1fc1c9e129
children
line wrap: on
line source

function [srfHandle, cbHandle] = logsurf(X,Y,Z, lim)
    absLogZ = log10(abs(Z));
    srfHandle = surf(X,Y,absLogZ);

    cbHandle = colorbar();
    colormap(hot(256));
    ah = gca();
    ah.CLim = lim;

    oldTickLabels = cbHandle.TickLabels;

    newTickLabels = {};

    for i = 1:length(oldTickLabels)
        newTickLabels{i} = sprintf('10^{%s}',oldTickLabels{i});
    end

    cbHandle.TickLabels = newTickLabels;
end