how to save the image obtained from the plot command?
Mostra commenti meno recenti
i have used the command "plot( cytoplasm1(:,2), cytoplasm1(:,1), 'g-', 'LineWidth', 1)" in my code. i don't know how to save the image that i am getting from this command into the folder... plz help me.....
Risposta accettata
Più risposte (1)
6 Commenti
sou
il 10 Ott 2014
Try this:
plot( cytoplasm1(:,2), cytoplasm1(:,1), 'g-', 'LineWidth', 1);
saveas(gcf,'my_wonderful_cytoplasm_image.png')
sou
il 11 Ott 2014
Stephen23
il 13 Ott 2014
It is saved in a folder: your current folder . If you want to put it in a subfolder of the current directory, you can use:
saveas(gcf,'my_subfolder\my_wonderful_cytoplasm_image.png')
Image Analyst
il 13 Ott 2014
I would not use the cd function. I'd use fullfile() as per the FAQ.
fullFileName = fullfile(folder, baseFileName);
The FAQ explains further why this is the recommendation: http://matlab.wikia.com/wiki/FAQ#Where_did_my_file_go.3F_The_risks_of_using_the_cd_function.
Sure. I was not trying to imply that they should change the Current Folder for just that one operation, but I have noticed that some users do not seem to realize that the Current Folder can be changed at all, yet their work would be much simpler if they simply changed to a more convenient directory.
Categorie
Scopri di più su File Operations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!