Temporarily expand (enlarge) the submarine figure - then roll it back

Often in Matlab we build a shape with many subplot axes, but they are all tiny.

In the common UX paradigm, you expect to be able to double-click on such a small chart to take a closer look at the entire screen.

This is usually the reason why I avoid using it subplot, but draw a lot of separate shapes instead, so I can move them around the screen and double-click on their headings, which (on Windows) maximize the shape on the whole screen. (Double click again and it will revert to its normal size.)

However, the advantage subplotis that the set of graphs is grouped in one panel. When I draw a lot of such groups (each with a dozen separate subplot axes), so that many separate shapes work hard.

So, is there a way to activate this functionality in Matlab already?

+4
source share
1 answer

Combining the parts of these three , here is what I still have:

h = subplot(2,2,1);
line(1:10, rand(1,10));
set(h, 'buttondownfcn', ['h=gca; hc = copyobj(h, gcf);' ...
    'set(hc, ''Units'', ''normal'',' ...
    ' ''Position'', [0.05 0.1 0.8 0.85],' ...
    ' ''buttondownfcn'', ''delete(gca)'');']);

It is not perfect, but it works.

enter image description here

Click on the axis:

enter image description here

Click on the extended axes and disappear:

enter image description here

, , " 3D" . " ", , . : , , . "" .

, . - , .


( uipanel, ), :

gcaExpand.m:

function gcaExpand

    set(copyobj(gca, uipanel('Position', [0 0 1 1])), ...
       'Units', 'normal', 'OuterPosition', [0 0 1 1], ...
       'ButtonDownFcn', 'delete(get(gca, ''Parent''))'); 

end

gcaExpandable.m:

function gcaExpandable

    set(gca, 'ButtonDownFcn', [...
        'set(copyobj(gca, uipanel(''Position'', [0 0 1 1])), ' ...
        '    ''Units'', ''normal'', ''OuterPosition'', [0 0 1 1], ' ...
        '    ''ButtonDownFcn'', ''delete(get(gca, ''''Parent''''))''); ']);

end

. , . .

Matlab, . , .

subplot, gcaExpandable, , plot ButtonDownFcn ( , ). , NextPlot 'replacechildren', . , plot . , .

+1

All Articles