Effacer les filtres
Effacer les filtres

How to modify figures programmatically?

5 vues (au cours des 30 derniers jours)
Ali Baig
Ali Baig le 29 Août 2018
Commenté : Walter Roberson le 29 Août 2018
I am trying to write a code which
  1. Full screen the figure.
  2. Plots the graph.
  3. Change font size to 24.
  4. Change line width to 2.
  5. Turns grid on, and labels x, and y-axes.
  6. Put a legend with font size 24.
  7. Saves the file as eps, png, and fig with 600 dpi resolution.
figureFullScreen
loglog(x1, y1, x2, y2)
set(gca,'fontsize', 24)
set(findall(gca, 'Type', 'Line'),'LineWidth',2);
grid on, xlabel('\Delta x'), ylabel('Maximum Error')
legend({'Maximum Error in Conventional Scheme','Maximum Error in Proposed Scheme'}, 'FontSize', 28)
print(gcf, 'OneD_E1_a1_Convergence_Study_Max_Error','-depsc','-r600');
print(gcf, 'OneD_E1_a1_Convergence_Study_Max_Error','-dpng','-r600');
savefig('OneD_E1_a1_Convergence_Study_Max_Error.fig'),
Now I want to achieve
  1. Save .fig file in 600 dpi.
  2. expand axis to fill figure.
I need help with these 2 task.
Thank you.
  2 commentaires
dpb
dpb le 29 Août 2018
See the 'Position' and 'OuterPosition' properties and 'Units'
I'm not sure you can enforce a specific dpi into the .fig file.
Walter Roberson
Walter Roberson le 29 Août 2018
.fig files cannot be saved as a particular resolution. .fig files are copies of the graphics objects such as the line and legend objects as data structures. .fig files are not rendering of graphics, they are the data structures that you can reload to recreate the graphics objects.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Specifying Target for Graphics Output dans Help Center et File Exchange

Produits


Version

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by