Semilogy Subplot Multiple figures not working

6 views (last 30 days)
Pat
Pat on 27 Mar 2015
Commented: dpb on 27 Mar 2015
I'm having trouble plotting multiple figures using subplot and semilogy. Only the last figure appears in semilogy
h = figure(2);
for k = 1:length(T0)
subplot(2,2,k);
semilogy(P0,squeeze(ploss(k,1,:)),'b');
str1 = strcat('\leftarrow', sprintf('max = %4.2f',max(massflow(k,1,:))));
text(max(P0),max(squeeze(massflow(k,1,:))),str1);
hold on;
semilogy(P0,squeeze(ploss(k,2,:)),'r');
hold off;
str1 = strcat('\leftarrow', sprintf('max = %4.2f',max(massflow(k,2,:))));
text(max(P0),max(squeeze(massflow(k,2,:))),str1);
xlabel('Upstream Pressure Pa');
ylabel('Pressure Loss %');
title(sprintf('Valve Diameters and Pressure Loss, T0 = %d K',T0(k)));
legend('8 in','10 in');
end
  1 Comment
dpb
dpb on 27 Mar 2015
Must have something to do with either version or the use of hold The following shows both log y-axes here w/ R2012b
>> for i=1:2,subplot(2,1,i),semilogy(1:10,exp(rand(1,10))),end

Sign in to comment.

Answers (0)

Categories

Find more on Downloads in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!