How do I use Saveas function to save figure2 ?
2 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
HARSHA M BHONSLE
le 19 Mai 2023
Réponse apportée : Walter Roberson
le 19 Mai 2023
I have a Matlab code with multiple figures present in it.But I want to save Figure 2 as a jpg format.
I have seen people using "saveas(gcf,'Barchart.png')" and gcf is used for getting the current Fig. But I want only Figure2 to be saved as Barchart.png and not any other figure.
0 commentaires
Réponse acceptée
Walter Roberson
le 19 Mai 2023
saveas(2,'filename.jpg')
For more security,
fig2 = figure(2);
saveas(fig2, 'filename.jpg')
.. you should probably have a handle to the figure anyway, as you need to use the handle in some operations to ensure that you are working with the figure you want.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Graphics Object Identification 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!