Plottng problems in saving

조회 수: 1 (최근 30일)
Mahesh
Mahesh 2015년 6월 2일
댓글: Muhammad Usman Saleem 2015년 6월 2일
Dear all I am having a problem with saving and displaying the figugres. While I use follwoing macro, most of the title texts are away from the border of the canvas as in figure 1
But while just saving from matlab console i got as in Figure 2
So could you please suggest me how I can be fixed. Soon response will be appreciated Thank you in advance
function [f] = plotdy(data, dy, normdy, maxpk, Tlabel)
close all;
clc;
ndata = numel(data);
cumR = cumsum(data);
cumP = cumsum(dy);
gr1 = 0.25;
f = figure(1);
set(f,'OuterPosition',[50 300 1500 600]);
set(f,'PaperUnits','inches');
set(f,'PaperPosition',[0 0 17.6 5])
dyplot= subplot(1, 4, [1 3]);
plot(1:ndata,normdy,'-k', 'LineWidth',1.0);
set(dyplot,'FontSize',28)
set(gca,'Xtick',[1 ndata]);
set(gca,'Xlim',[1 ndata]);
set(gca,'TickLength',[0 0]);
y_lim = [-0.05 str2double(num2str(maxpk,2))];
y_tick = [0 str2double(num2str(maxpk,2))];
set(gca, 'Ytick', y_tick);
set(gca,'Ylim',y_lim);
t1 = title(Tlabel);
set(t1, 'FontSize',32);
cumplot = subplot(1, 4, 4);
hold on
plot(1:ndata, cumR, '-k', 'LineWidth',1.25);
plot(1:ndata, cumP,'Color',0.25*ones(1,3));
Lc = min(min(cumR), min(cumP));
Uc = max(max(cumR), max(cumP));
fitline = linspace(Lc, Uc, ndata); fitline=fitline(:);
plot(fitline, '-k');
hold off
set(cumplot,'FontSize',28)
set(gca,'Xtick',[0 ndata]);
set(gca,'Xlim',[0 ndata]);
set(gca,'TickLength',[0 0]);
set(gca,'ytick',[0 1]);
set(gca,'ylim',[-0.25 1]);
set(gca,'LineWidth',1.5);
box on
end
  댓글 수: 1
Muhammad Usman Saleem
Muhammad Usman Saleem 2015년 6월 2일
save both figure isolately... And to me your figure are different from border reason is you place hold on /off wrong in program

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Graphics Object Programming에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by