Code covered by the BSD License  

Highlights from
Celsius-Fahrenheit thermometer

image thumbnail
from Celsius-Fahrenheit thermometer by Loren Shure
Dual-scale Thermometer

cftemp(figure1)
function cftemp(figure1)
% Celsius-Fahrenheit thermometer.
 
%   Copyright 2005 The MathWorks, Inc.

%  And updated by Loren Shure on
 
 
%% Create figure
if nargin < 1
    figure1 = figure;
end
 
%% Create axes, two overlaying each other - one with label on left, one on
%% right
axes1 = axes(...
  'Position',[0.475 0.11 0.05 0.815],...
  'XTick',[0 1],...
  'XTickLabel',{' ',' '},...
  'YColor',[0 0 1],...
  'YTick',-10:5:40,...
  'Parent',figure1);
axis(axes1,[0 1 -10 40]);
ylabel(axes1,'^o C');
 
%% Create axes
axes2 = axes(...
  'Position',[0.475 0.11 0.05 0.815],...
  'XTick',[0 1],...
  'XTickLabel',{' ',' '},...
  'YColor',[0 0.5 0],...
  'YAxisLocation','right',...
  'YTick',10:10:100,...
  'Color','none',...
  'Parent',figure1);
axis(axes2,[0 1 14 104]);
ylabel(axes2,'^o F');
 

Contact us at files@mathworks.com