Info

Diese Frage ist geschlossen. Öffnen Sie sie erneut, um sie zu bearbeiten oder zu beantworten.

Saving a plot with part of it filled with colour as an image

1 Ansicht (letzte 30 Tage)
med-sweng
med-sweng am 25 Nov. 2014
Geschlossen: MATLAB Answer Bot am 20 Aug. 2021
I have the following code portion where an plot is drawn, and part of it is filled with a white colour;
plot(x,y,'Color',color,'LineWidth',lineWidth);
fill(x,y,[1 1 1]);
How can I save this plot as an image, aka as imwrite for images.
Thanks.

Antworten (2)

Image Analyst
Image Analyst am 25 Nov. 2014
You can use the most downloaded File Exchange submission of all time: export_fig: http://blogs.mathworks.com/pick/2010/05/28/creating-and-exporting-publication-quality-graphics/
  2 Kommentare
med-sweng
med-sweng am 25 Nov. 2014
Thanks for your reply. Yes, I knew about export_fig from a past answer of yours. The issue here is that I couldn't figure out what to pass as a parameter to the function: export_fig(varargin)
Image Analyst
Image Analyst am 25 Nov. 2014
Good, I'm glad you (hopefully) already have it. I believe you can just pass the current figure, gcf, or the current axes, gca, whichever you want to save.

Panayiotis Christodoulies
Panayiotis Christodoulies am 25 Nov. 2014
Have a look at this web page:
It contains examples that show how to use export_fig. The webpage was created by Oliver Woodford who developed the export_fig code.

Diese Frage ist geschlossen.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by