フィルターのクリア

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 Center および File ExchangeGraphics Object Properties についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by