Per salvare la figura come file (non importa come è stata creata), si dovrebbe fare :
saveas(figureHandle,'filename','format')
dove figureHandle potrebbe essere la maniglia gcf
, che significa: ottenere cifra attuale.
Come sottolineato nella discussione, se qualcuno non vuole che le zecche da mostrare, la persona può aggiungere:
set(gca,'XTick',[])
set(gca,'YTick',[])
dove GCA è la maniglia per l'asse attuale, proprio come gcf
. Se hai più di un asse, non dimenticare di "gestire le maniglie". Essi vengono restituiti al mondo quando si tratta di creare, vale a dire:
hFig = figure(pairValuedProperties); % Create and get the figure handle
hAxes1 = suplot(2,1,1,pairValuedProperties); % Create and get the upper axes handle
hAxes2 = suplot(2,1,2,pairValuedProperties); % Create and get the bottom axes handle
in cui il valore di coppia è la figura o assi proprietà dichiarate nella seguente sintassi:
'PropertyName1',PropertyValue1,'PropertyName2',PropertyValue2,…
Ecco la documentazione MATLAB su il Figure e Axes Properties e circa lo saveas method.
Esempio:
L'immagine salvata con il seguente codice:
figure
imagesc(magic(3))
set(gca,'XTick',[]) % Remove the ticks in the x axis!
set(gca,'YTick',[]) % Remove the ticks in the y axis
set(gca,'Position',[0 0 1 1]) % Make the axes occupy the hole figure
saveas(gcf,'Figure','png')
È 'saveas (gcf, 'filename', 'format')' cosa vuoi? Prova un formato vettoriale come .eps – Werner
@Werner: Grazie per la risposta, potresti elaborare per favore. – motiur
@Werner: Grazie amico, funziona, * abbracci *. – motiur