Main Content

hgexport

(Removed) Export contents of figure

    hgexport has been removed. For more information, see Version History.

    Description

    hgexport(fig,filename) exports the contents of the figure fig to an EPS file with the specified file name.

    example

    hgexport(fig,"-clipboard") copies the contents of the figure to the clipboard. This syntax is supported on Windows® systems only.

    The content is copied either as vector graphics or as an image, depending on the content in the figure.

    Examples

    collapse all

    Create a plot and get the current figure by calling the gcf function.

    plot([0 0.3 0.1 0.6 0.4 1])
    fig = gcf;
    

    Line plot

    Save the contents of the figure to the file myplot.eps

    hgexport(fig,"myplot.eps")

    Input Arguments

    collapse all

    Figure to export, specified as a figure object.

    File name, specified as a string scalar or a character vector.

    Example: hgexport(gcf,"myfile.eps") specifies a string scalar for the file name.

    Example: hgexport(gcf,'myfile.eps') specifies a character vector for the file name.

    Version History

    Introduced before R2006a

    expand all