1

I run matlab in batch mode on server, which doesn't have graphics. I generate plots and save them to file as follows:

h = figure;
hold on;
% plotting code
title('some non-ascii title', 'FontName', 'liberation serif');
print(h, 'result', '-depsc');

but it gives me gibberish instead of proper title.

In graphical mode, the same code outputs expected image.

I am using Matlab version 7.6, 2008a. What am I doing wrong?

Rogach
  • 26,050
  • 21
  • 93
  • 172
  • @EitanT - I really don't need latex. I need a simple image (be it .eps or .png, no matter). I tried to use exportfig, it gives me some warning about OpenGL (` OpenGL mode can not be used in terminal emulation mode; ignoring option.`), and outputs image at 180x150 resolution, which is way to small even to read the title. '-m2' doesn't affect the size of the image. – Rogach May 26 '13 at 15:16

1 Answers1

2

You have full access to all Tex characters text(1,1,''\delta \pi'') prints a delta and a pi at point 1,1.

On a server without a graphics card its best to never even render the image. Eg set(0,'DefaultFigureVisible','off') on your session save the figures as matlab structs using handle2struct or the disk version hgsave('filename.mat'). Then render the figures on a server with a gpu using struct2handle or the disk version hgload.

Good Documentation on adding TEX, Undocumented handle2struct

Philliproso
  • 1,278
  • 1
  • 9
  • 16