% function ThermoScala

% ______ Design :  Thermometer  für Celsius & Fahrenheit  _____
% ____________________________________________________
clear all; close all; clf

fprintf(1, '\n')   
disp(['°°°°°°°°°°°°° S T A R T °°°°°°°°°°°° ' ,date, ' °°°°°°°°°°°°°°'])

% :::::::::::::::::::::::::: Scaling : Celius ::::::::::::::::::::::
Cels = linspace(-50, 50, 11);
cmin = min(Cels);
cmax = max(Cels);
M = 51;
colormap(jet(M));                           % -> colormap [jet] for Thermometer
% :::::::::::::::::::::::::::::::::::::
figure(1)
subplot(121)
    p1 = pcolor([Cels; Cels]');               % > muster :  vertical  
    title('\bf Pcolor - Muster : vertical')
    pause(1)
    % :::::  > reduce Width by 1/2 :::::::::::::::.
    pos = get(gca,'position'); 
    pos(3) = 0.5*pos(3);                      % 
    set(gca,'position',pos)
    pause(1)
    % ::::::::::  Labels for pcolor  :::::::::::::
    xticks =  get(gca, 'Xtick');
    yticks =  get(gca, 'Ytick');
    set(gca, 'Xticklabel', [])
    % :::::::::: Colorbar ::::::::::
    CA = colorbar('vert');
    posCA = get(gca, 'position')
    pause(1)

% :::::::::::::::::::::::::::::::::::::::::::.
subplot(122)
    HB = pcolor([Cels;Cels]');                    % > muster :  horizontal       
    titstr(1) ={'\bf Thermometer - Umrechung '};
    titstr(2) ={'\bf Celsius & Fahrenheit'};
    titstr(3) = {' '}
    title(titstr, 'VerticalAlignment','bottom','Color',[0.2 0.06 0.92], 'fontsize', 16);
    % :::::::::::::::: Positioning for  Pcolor :::::::::::::::::::::
   % :::::  > reduce Width by 1/2 & High by 1/4 :::::::::::::::.
    posHB = get(gca,'position'); 
    posHB(3) = 0.5*posHB(3);                     
    posHB(4) = 0.75*posHB(4);
    set(gca,'position',posHB)
    % ::::::::::  Labels for pcolor  :::::::::::::
    yticks = get(gca,'YTick'); 
    xticklabel =  get(gca, 'Xticklabel');
    set(gca, 'XTicklabel', [])
    % :::::::::::::::::::::: generate new Y-tick-Strings :::::::::::::::::: 
    for i = 1: length(yticks) 
        newtick{i} = num2str(Cels(i)*9/5+32,'%0.f'); 
    end 
    % ::::::::::: Transforming : Cell - String :::::::::::::::::::::
    Fa = repmat({' F'}, length(yticks),1);                % > Wiederholungen
    ylab = strcat(newtick', Fa);
    set(gca,'yticklabel', ylab, ...  
               'fontweight','bold', 'fontname', 'Ashton-F1', 'Fontsize', 14) 
    % :::::::::: Colorbar :::::::::: 
    CB = colorbar('peer', gca);
    caxis([cmin cmax]);
    % ::::::::::  Labels  for Colorbar  :::::::::::::
    yticklabel =  get(gca, 'Yticklabel');
    pause(1) 
    ylabel = get(CB, 'YTickLabel');
    Ce = repmat(' °C', length(yticks),1);                % > Wiederholungen
    ylabel = strcat(ylabel , Ce);
    set(CB,'YTickLabel', ylabel, ...
               'fontweight','bold', 'fontname', 'Ashton-F1', 'Fontsize', 14) 
    % :::::::::::::::: New colorbar positioning :::::::::::::
    pause(1)
    set(CB, 'pos', posHB)
    pause(1)
    
    % ::::::::::::::::::::::::::    Legend - not here ::::::::::::::::::::
    s = cell(1, 2);
    for k=1: 2
        s{k} = sprintf('Temp. of Cels %d', k);
    end
    % hL = legend( s, 0 );

