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 Center および File ExchangeAdding custom doc についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by