Effacer les filtres
Effacer les filtres

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

1 vue (au cours des 30 derniers jours)
Ivy Chen
Ivy Chen le 2 Juil 2018
Commenté : Ivy Chen le 2 Juil 2018
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 commentaires
jonas
jonas le 2 Juil 2018
It is not clear to me what your desired output is
Ivy Chen
Ivy Chen le 2 Juil 2018
thanks, I found an issue in the other part of codes. Problem resolved. thanks again

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Graphics Object Properties dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by