altmany / export_fig

A MATLAB toolbox for exporting publication quality figures
BSD 3-Clause "New" or "Revised" License
1.28k stars 368 forks source link

exporting to clipboard demands an output file name #372

Closed mwjacobson closed 1 year ago

mwjacobson commented 1 year ago

Hi Yair, It is a bit strange to me that, when exporting to the clipboard, a file name must be provided to avoid an error, or so I find with this example,

hax=gca
set(hax.XAxis,'Color','r','LineWidth',6)
set(hax.YAxis,'Color','r','LineWidth',6);
hax.Color='none';
xticks([]);
yticks([]);
box
axis image

export_fig(hax,'-transparent','-clipboard')

results in

Error using matlab.graphics.axis.Axes/get
Unrecognized property FileName for class Axes.

Error in export_fig>parse_args (line 1977)
        options.name = get(fig,'FileName');

Error in export_fig (line 399)
    [fig, options] = parse_args(nargout, fig, argNames, varargin{:});

Error in test (line 12)
export_fig(hax,'-transparent','-clipboard')
altmany commented 1 year ago

Fixed