How do I change the resolution of my MATLAB graphs? The default seems to be 96×96 PPI.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can save using the
printcommand; here’s how:The
-r150argument sets the resolution to 150 DPI. you can set it higher or lower depending on your need. This is assuming you’re saving as a JPEG. If not, there are other options such as-dpngfor PNG,-dbmpfor 24-bit bitmap, etc. more can be found in the help section forprint.That said, if your plot consists only of lines, I would recommend using
-depscwhich saves it as an EPS file, which is scalable and lossless. You also won’t have to define a resolution, so you can simply doprint(h1,'-depsc','filename')You can convert this EPS file to PDF and retain the same resolution, yet have portability between applications and platforms. I wouldn’t recommend saving to PDF directly as MATLAB puts additional white spaces around the plot, wheras the EPS bounding box is tight, and looks neat.