Color printing in Matlab on Linux

The Linux version of Matlab (2013a at least) defaults to printing in black and white. To print in color, you either have to specify another printer driver as an argument to print (“-dps2c” instead of “-dps2”) or manually select “color” from the “color scale” tab in the print preview dialog. The default for this setting is stored in: $MATLAB/toolbox/local/printopt.m. Look for the line that says dev = '-dps2'; and change it to dev = '-dps2c';.

While you’re at it, you can change default paper size, units and more by editing startup.m. My configuration looks like this:

set(0, 'DefaultFigurePaperType','A4');

set(0, 'DefaultFigurePaperPositionMode', 'Manual');
set(0, 'DefaultFigurePaperUnits', 'Centimeters');

set(0, 'DefaultFigurePaperOrientation', 'Landscape');
set(0, 'DefaultFigurePaperPosition', ...
[1 1 -2 -2] * 1 + ... % Set margin here
[0 0 29.7 21.0]); % Size of A4 in landscape format

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s