MATLAB: Save figure save figure How do I save this figure and supress so that the figure isn't actually shown? data=load('data.txt')plot(x) Best Answer h=figure('visible','off');plot(h,1:10);saveas();close(h); Related SolutionsMATLAB: Figure Visibility and Save a=1:4;f = figure('visible','off');plot(a)saveas(f,'newout','fig')Now to reopen the figure% to open the figure openfig('newout.fig','new','visible') MATLAB: How to plot without rendering the figure window and also save the figure to disk in MATLAB 7.10 (R2010a) Use the following code to create plots in the background and save them to disk (ex: JPEG Format)h = figure('Visible','Off'); % Creating a figure and not displaying itax = axes; % Create an Axes;plt = plot(ax,1:10,1:10,'r'); % Plot an arbitrary line in the axes set(h,'CurrentAxes',ax); % Set current Axes of figure to 'ax'print(h,'-djpeg','fname.jpeg')% Print the plot to file 'fname.jpeg' Related QuestionFigureSave figure in GUI
Best Answer