====== Generating nice images in Matlab ====== You may be using Matlab to create graphics. Some considerations: - Save all data or all scripts. Get in the habit of saving data as ''%%.mat%%'' files. - Create scripts that will load in ''%%.mat%%'' files and plot the data. This means if you ever need to regenerate pictures, you can do it very easily. - Similar to above, you may want to save ''%%.fig%%'' files of the pictures. Again, it allows fine-tuning. (In fact, you can extract raw data from ''%%.fig%%'' files via scripts if you look into it). To save such a file, simply click File > Save-As on the figure window. - Use [[https://uk.mathworks.com/matlabcentral/fileexchange/23629-export_fig|export_fig]] package (Matlab file exchange) to export to pdf format. In general, output to PDF format unless the image is very detail-heavy (surface plots, contour plots, etc.). This ensures that the image is scalable and crisp. Once you have downloaded the ''%%export_fig%%'' package, unzip it and move the folder into a unified functions folder on your computer. Refer to the [[it_matlab_startup|startup.m]] guide. By doing so, you can issue a command like export_fig 'test.pdf' in order to produce a PDF of the currently targetted figure.