필터 지우기
필터 지우기

Plot does not have axes properties set correctly, nor saved correctly.

조회 수: 1 (최근 30일)
Ivy Chen
Ivy Chen 2018년 7월 2일
댓글: Ivy Chen 2018년 7월 2일
I have a plot need to apply for axes and save to a different size. When I use the following script, it does not save the empty plot.
H_error = CarolinaPulledPork.horizontal_error(Idx);
plot(X, H_error,'DisplayName','Horizontal Position Error','LineWidth', 2);
% Create title, x & y lables, and legend
ax=gca;
set(ax,'FontSize',24, ...
'XColor',[0.0784313753247261 0.168627455830574 0.549019634723663], ...
'YColor',[0.0784313753247261 0.168627455830574 0.549019634723663]);
set(ax,'XTick',linspace(plot_start,plot_end,16), ...
'xlim',[plot_start plot_end], 'ylim',[0 50]);
datetick('x', 'HH:MM', 'keepticks', 'keeplimits');
xlabel(plotname,'FontWeight','bold','FontAngle','italic','FontSize',24, ...
'Color',[0.0784313753247261 0.168627455830574 0.549019634723663]);
ylabel('Horizontal Position Error (m)', ...
'FontWeight','bold','FontAngle','italic','FontSize',24, ...
'Color',[0.0784313753247261 0.168627455830574 0.549019634723663]);
legend show;
set(legend,'Location','southoutside','Orientation','horizontal','Box','off','FontSize',24);
filename = sprintf('Horizontal Position Error vs Time for Day %s - Scenario %s.png', Day, Scenario);
% Convert to a different size) and Print to PNG file
set(gcf, 'Position', [0 0 2400 600]);
print(gcf, filename,'-dpng','-r0');
  댓글 수: 2
jonas
jonas 2018년 7월 2일
It is not clear to me what your desired output is
Ivy Chen
Ivy Chen 2018년 7월 2일
thanks, I found an issue in the other part of codes. Problem resolved. thanks again

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

답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by