How can I save a figure (in jpeg and pdf) from this code?
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Display a geographic globe in a figure created using the uifigure function.
uif = uifigure;
g = geoglobe(uif);
0 Commenti
Risposte (1)
DGM
il 13 Set 2024
Modificato: DGM
il 14 Set 2024
At least as of R2019b, saveas() and print() do not accept uifigure handles. The documentation suggests that's still the case, but my network connection is too crappy to open MATLAB online to verify that.
Documentation suggests that exportgraphics() should accept uifigure handles, but again, I cannot test that. It should support PDF outputs as well. Depending on what you're doing, maybe exportapp() is appropriate.
As always, using JPG for anything is usually a completely bad idea. For synthetic graphics with hard edges and flat coloring, JPG will produce a visually conspicuous degradation of image quality, and the file size will typically be larger than a PNG. Unless you understand what compromises come with a 70% 4:2:0 JPG, don't use JPG.
2 Commenti
DGM
il 14 Set 2024
Is that documented anywhere? Webdocs doesn't mention uifigure, and the closest relevant notes in RN is about removing support for UI elements in an undisclosed future release. From R2022b and R2023b:
These functions and menu items will no longer support printing or exporting UI components in a future release:
• The print function
• The saveas function
So they're going to remove support for saving uifigures containing buttons and stuff using these tools -- but as far as I know, they don't support uifigures anyway. What am I missing?
I'd test this, but again, I can't even get MATLAB online to load.
Vedere anche
Categorie
Scopri di più su Audio and Video Data in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!