Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 457
Marco Avatar asked Mar 16 '23 10:03

Marco


1 Answers

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.

like image 114
Setsu Avatar answered Apr 07 '23 07:04

Setsu