物探论坛

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1072|回复: 0

[算法] PowerPoint Exporter

[复制链接]
发表于 2013-11-24 11:17:46 | 显示全部楼层 |阅读模式
pptfigure
PowerPoint Exporter

Syntax
pptfigure
pptfigure add
pptfigure delete
pptfigure all
pptfigure on
pptfigure off
pptfigure(H)
pptfigure(H,'PropertyName',PropertyValue,...)
pptfigure('PropertyName',PropertyValue,...)
H = pptfigure(...)
Description
pptfigure creates a new Matlab figure with a PowerPoint Export button on the toolbar. Pressing the button exports the figure to PowerPoint with default property settings. After exporting, various features of the figure are automatically edited directly in PowerPoint to allow easy subsequent editing.
pptfigure add places a PowerPoint Export button on the toolbar of the current figure.
pptfigure delete removes any existing PowerPoint Export button from the toolbar of the current figure.
pptfigure all places a PowerPoint Export button on the toolbar of each opened figure.
pptfigure on turns on the option to automatically place a PowerPoint Export button on each newly created figure in the future. This will affect any Matlab process that creates a new figure.
NOTE: a convenient option is to create a startup.m file containing the line pptfigure on. This will automatically place PowerPoint Export buttons on all new figures in future Matlab sessions.
pptfigure off turns off the automatic button placement option.
pptfigure(H) exports Figure H to PowerPoint. Equivalent to clicking the PowerPoint Export button (if available) on the toolbar. If Figure H does not exist, creates a new figure with handle H and a PowerPoint Export button on the toolbar.
pptfigure(H,'PropertyName',PropertyValue,...) exports Figure H to PowerPoint with specified property names and values.
pptfigure('PropertyName',PropertyValue,...) changes default property values used by pptfigure (e.g. when the toolbar PowerPoint Export button is pressed). Defaults are stored in a workspace structure variable pptfigureDefaults. Clear this variable to reset all default property values.
H = pptfigure(...) If buttons were added or removed, returns the handles of all affected figures. If a figure was exported, returns the affected slide number in PowerPoint. Otherwise returns 0.
Properties
AutoGroupMin
integer value (default is 5)
Smallest number of objects that are automatically grouped. This property determines how many objects within single axes are required to trigger automatic grouping. Only objects of a single type, such as textboxes, are automatically grouped. Furthermore, automatic grouping only operates on objects that have not been manually grouped with the Groups property. For lineseries and textbox objects, automatic grouping additionally requires objects to have identical formatting (e.g., color, alignment, line width, etc.). See grouping for details.
BackVisibility
{auto} | on | off
Visibility of figure and axes background colors. This property determines whether background colors of the figure and axes are exported. If exported, background colors appear as colored PowerPoint rectangles behind other objects.
·          auto - only export those colors that are different from default colors.
·          on - export all background colors.
·          off - do not export any background colors.
BitmapResolution
empty array (default), resolution in dpi (single integer value), or array of resolution values
Exporting in bitmap format. This options allows exporting some of the objects in bitmap, rather than metafile, format. Objects exported this way are not editable in PowerPoint. Use this for plots that have extremely large numbers of objects. The difference between this option and standard bitmap exporting is that it allows leaving some objects (e.g., axes or text labels) in metafile format and thus individually editable in PowerPoint.
·          empty array - do not export any objects in bitmap format. Everything is exported in metafile format.
·          integer value - export objects as bitmap images at the specified resolution.  If groups are specified, each group is exported as a separate bitmap image. Objects not included in groups are exported in metafile format. If no groups are specified, all children of each axis are exported as a separate bitmap image. Axes and axes labels are not included in bitmap images and are exported in metafile format.
·          array of values - apply different resolution values to different groups (if groups are specified) or to different axes (if no groups specified). The length of the array must match the number of groups in the former case or the number of axes (excluding legends) in the latter case. NaN value in the array excludes the corresponding axis or group from bitmap exporting and exports it in metafile format instead.
MetaResolution
resolution of metafile images in dpi (default is 0).
Image resolution. Specifies resolution at which objects are exported to PowerPoint. A value of 0 (default) exports objects at the screen resolution. This property does not apply to any objects that are exported as bitmap images; use BitmapResolution for those instead.
Groups
array of handles or cell array containing arrays of handles (empty by default)
Manual grouping of objects. This property determines which objects are manually grouped for exporting as a single object into PowerPoint. Use an array of object handles to specify a single group or a cell array to specify single/multiple groups. Groups take precedence over AutoGroupMin; only objects that have not been manually grouped are considered for automatic grouping. Manual grouping can operate on objects of different formats or types, and even on objects from different axes. See grouping for details.
Height
height in inches (empty by default)
Height of the figure in PowerPoint. If empty, the height is determined automatically.
Left
horizontal position in inches (empty by default)
Position of the left edge of the figure in PowerPoint. If empty, the figure is automatically centered in the PowerPoint slide.
SlideNumber
integer value or one of the following strings:
{append} | last | current
PowerPoint slide to which the figure is exported.
·          integer value - slide number in the current presentation.
·          append - add a new slide to the presentation.
·          last - last slide of the presentation.
·          current - currently selected slide.
SwitchSlide
Boolean value (true by default)
Slide switching after exporting. Determines whether PowerPoint selects the affected slide after exporting. In some cases, it may be convenient to set this property to false in order to export multiple figures to the same slide.
Top
vertical position in inches (empty by default)
Position of the top edge of the figure in PowerPoint. If empty, the figure is automatically centered in the PowerPoint slide.
Width
width in inches (empty by default)
Width of the figure in PowerPoint. If empty, the width is determined automatically.
PowerPoint Features
pptfigure edits various features of figures directly in PowerPoint after exporting in order to make them easily editable and presentable. In doing so, it solves several problems that arise from standard exporting methods, such as copy-pasting.
·          Format conversion. pptfigure pastes Matlab figures directly into PowerPoint in metafile format and converts them to PowerPoint objects. This way, all exported objects within the figures are individually editable in PowerPoint without the need for any additional conversion or importing.
·          Textbox alignment. Standard exporting methods cause textboxes to become misaligned when figures are resized or fonts are changed in PowerPoint. (A very common problem is the misalignment of tick marks with tick labels). pptfigure solves this problem by modifying horizontal alignment and vertical anchoring properties of all textboxes directly in PowerPoint.
·          Exponential labels. When exporting logarithmic axes or axes that use scientific notation (e.g. x106), standard methods create a separate PowerPoint textbox for each exponent. Thus, two slightly offset textboxes are created for each tick label, making subsequent editing and alignment extremely difficult in PowerPoint. pptfigure solves this problem by removing extraneous textboxes and instead applying superscript formatting to each appropriate label directly in PowerPoint.
·          TEX formatting. When exporting TEX-formatted textboxes, standard methods create a separate PowerPoint textbox for each special character (e.g. Greek letter or mathematical symbol) and each group of differently formatted characters (e.g., color, subscripts, etc.). This makes subsequent editing extremely difficult in PowerPoint. pptfigure solves this problem by placing all text into a single PowerPoint textbox and directly modifying the format of individual characters. It also converts all special characters to Unicode and inserts the corresponding symbols into the textbox.
·          Textbox colors. When exporting a textbox that has background or edge color, standard methods create separate colored rectangle objects in PowerPoint in addition to the actual textbox. This makes subsequent size/font changes difficult because rectangles and the textbox become easily misaligned. pptfigure eliminates extraneous rectangles and instead applies appropriate fill color and outline settings directly to the PowerPoint textbox. It also directly modifies textbox margins in PowerPoint to match their appearance in Matlab.
·          Trace grouping. Standard exporting methods often split individual line traces into multiple PowerPoint objects. In order to modify these traces in PowerPoint, one must manually select each of these pieces. pptfigure solves this problem by combining pieces from a single trace into one PowerPoint group object, allowing one to change their format simultaneously.
·          Line style. Standard exporting methods often change the appearance of dashed, dotted, and dash-dotted lines. pptfigure solves this problem by directly modifying outline style settings of all line objects, converting them to standard PowerPoint style formats.
Grouping
Groups and AutoGroupMin properties provide the option of grouping multiple Matlab objects during exporting. Grouping exports these objects as a single PowerPoint group. The following points should be considered when using this option
·          Grouping dramatically speeds up exporting (roughly proportionally to the number of objects) and is recommended when more than a few similar objects are present in a plot.
·          Objects exported as a group can be bulk-modified in PowerPoint. They can also be ungrouped and modified individually, but selecting individual objects after ungrouping can be very inconvenient. In general, avoid including in any groups those objects that may need individual formatting. To prevent an object from being grouped automatically, use the Groups property to specify a group containing that one object.
·          Grouping objects of different types (such as lines with textboxes) or objects that have different formatting (such as textboxes with different background colors) is generally not recommended. This may prevent pptfigure from properly editing some PowerPoint Features on these objects. Only group diverse objects in extremely large figures, when speed is a priority.
pptfigure.zip (19.14 KB, 下载次数: 0, 售价: 3 物探币)

相关帖子

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|Archiver|手机版|小黑屋|物探论坛 ( 鄂ICP备12002012号 微信号:iwutan )

GMT+8, 2024-4-29 09:05 , Processed in 0.280888 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表