Borrar filtros
Borrar filtros

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

1 visualización (últimos 30 días)
Ivy Chen
Ivy Chen el 2 de Jul. de 2018
Comentada: Ivy Chen el 2 de Jul. de 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 comentarios
jonas
jonas el 2 de Jul. de 2018
It is not clear to me what your desired output is
Ivy Chen
Ivy Chen el 2 de Jul. de 2018
thanks, I found an issue in the other part of codes. Problem resolved. thanks again

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Graphics Object Properties en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by