Marco
Marco

Reputation: 377

How to plot figures but keeping them minimized in the taskbar?

Is there a way to actually create figures in matlab and keep them minimized in the taskbar?

I know I can use

h=figure;
set(h, 'Visible', 'off');

but in this way in the taskbar there is no figure icon.

I simply like to plot something but keep it minimized in the taskbar: how can I do it?

Upvotes: 5

Views: 1730

Answers (1)

Setsu
Setsu

Reputation: 1228

Matlab doesn't have built-in functions to do this, so the second best thing to do would be to use Java.

This is plucked straight from Undocumented Matlab:

plot(1:10);
jFrame = get(handle(gcf),'JavaFrame');
pause(0.1)  %//This is important
jFrame.setMinimized(true);

The pause is necessary because you'd otherwise get a NullPointerException because of the fact that the window hasn't been fully drawn yet.

Upvotes: 7

Related Questions