我在
this thread的底部找到了这个解决方案:
% create an example fig that we want to format with style file 'foo'
plot(rand(14,10));
% get style sheet info
snam='foo'; % The name of your style file (NO extension)
s=hgexport('readstyle',snam);
%apply style sheet info
fnam='myfig.jpeg'; % your file name
s.Format = 'jpeg'; %I needed this to make it work but maybe you wont.
hgexport(gcf,fnam,s);
并且在您当前的文件夹中应该是一个名为“myfig.jpeg”的文件,这是您在“foo”中创建的导出设置的图形.如果要查看样式文件选项,请在命令行中键入s.它应该是这样的结构,其中包含所有导出设置.
s =
Version: '1'
Format: 'jpeg'
Preview: 'none'
Width: 'auto'
Height: 'auto'
Units: 'points'
Color: 'rgb'
Background: 'w'
FixedFontSize: '10'
ScaledFontSize: 'auto'
FontMode: 'scaled'
FontSizeMin: '8'
FixedLineWidth: '1'
ScaledLineWidth: 'auto'
LineMode: 'scaled'
LineWidthMin: '2'
FontName: 'Wingdings'
FontWeight: 'auto'
FontAngle: 'auto'
FontEncoding: 'latin1'
PSLevel: '2'
Renderer: 'auto'
Resolution: 'auto'
LineStyleMap: 'none'
ApplyStyle: '0'
Bounds: 'loose'
LockAxes: 'on'
ShowUI: 'on'
SeparateText: 'off'