Need documentation for hgexport function

조회 수: 21 (최근 30일)
Ivan Abraham
Ivan Abraham 2017년 1월 20일
댓글: Allen Goldstein 2021년 1월 21일
After being introduced in R2007 even in R2016 there is very little documentation for the hgexport() function. Many different sources seem to use the function in numerous and different ways. Where can I find a comprehensive account of the many ways hgexport can be used? Specifically R2016 has a built in export settings called "Documents", "Presentations", "default". I would like to use the hgexport() function to load the Presentations style and apply it.
Trying
s = hgexport('readstyle','Presentations')
Seems to not help.
Error using hgexport
Style 'Presentations' does not exist.
Error in hgexport

답변 (1개)

Walter Roberson
Walter Roberson 2017년 1월 20일
hgexport('factorystyle') returns a built-in style.
exportsetupdlg.m checks the figure appdata 'Exportsetup' property to see if a style has been applied to the figure. If not then it looks for default style information and if not it initializes with factorystyle.
The settings you are looking at, Documents and Presentations, do not exist until the exportsetupdlg initialization is run. Internally it uses the names MSWord and PowerPoint
The style information for MSWord and PowerPoint is looked for in prefdir subdirectory ExportSetup in files MSWord.txt and PowerPoint.txt . It will write them there if it does not find them. So you could customize those files.
MSWord style defaults to the same as factorystyle.
PowerPoint style defaults to bold scaled fontsize 140 with fixed width lines.
Look near lines 1450 in exportsetupdlg.m
hgexport() can also be called with a figure, then a filename, then a style, then 'Format', then the name of one of the supported formats. The supported formats are extracted from the printtables() command which uses information about what is locally available. Look starting at roughly line 350 in filemenufcn.m
  댓글 수: 1
Allen Goldstein
Allen Goldstein 2021년 1월 21일
If you want to use the screen resoluton, you need to change the resolution to 0.
style = hgexport('factorystyle'); % get the style
style.Resolution = 0; % Resolution = 0 means use the screen resolution
hgexport(gcf,'-clipboard',style);

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 Adding custom doc에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by