Tuesday, July 17, 2007

Using Skim with MATLAB

I found a hint for using TeXShop as a MATLAB previewer on OS X, primarily because plots look better in PDF and TeXShop auto-updates files from disk. This was a tip from back in 2005. Since then, MATLAB's OS X plotting has gotten a lot better. Additionally, Skim has been invented.

Because of the advances in MATLAB, this may not be a useful hint anymore, but give this a try sometime:
figure(1);
set(gcf, 'Visible', 'off');
plot(x, y);
print(gcf, '-dpdf', 'figure1.pdf');
system('open -a Skim figure1.pdf');
Now, I believe there's a way to do this without having to plot first. That is, I think there's a way to plot to PDF without first generating that figure.

What's cool about this is that any future updates of the PDF will cause Skim to update automatically. Therefore, Skim becomes your plot viewer. That might be nice, right?

No comments: