axshift

Version 1.0.0.0 (4.09 KB) by paul koch
axshift() -funtion to manually resize and rescale subplots/axis within a figure
1.1K Downloads
Updated 13 Apr 2009

No License

rationale:
a] resize of subplots/axes manully in a wysiwyg fashion
b] multiple subplots with different sizes,
c] overlapping supplots (transparent or not), graphical overlay
d] create a layout with subplot locations for other figures/data

usage:
1] plot figure with subplots
2] type 'axshift'
3] an icon appears in the toolbar
4] if this icon is selected (colored)
-selected axes/subplots of the figure can be moved
5] via contextmenu (right mouse click in the figure,but not within a subplot)
the following functions are available
- BG-original: backgroundcolor of each subplot set to orig. color
- BG-none: transparent background
- position-original: original positions of the subplots
- position-last one: previous positions
- positions to workspace: parse new positions of all subplots to the workspace. This might
be usefull for creating template layout for other data, The order of positions equals the order of the
originally plotted subplots

- resize all: resize all subplots by means of the mouse wheel (backwards: larger; forward: smaller)
note: a size of 100% refers to the size when the 'resize all'-function is executed.
- resize indiv: if selected an axes, drag the corner-and midpoints of the subplot to resize the axes
- shift axes: selected axes/subplots of the figure can be moved

6] additionally there are 3 shortkeys for fast switching between
shifting and rescaling functions
(press key if the figure is active)
[a]: activate the 'resize all' function
[d]: activate the 'resize indiv' function
[s]: activate the 'shift axes' function

example: you can use this example to play around
figure('color',[1 1 1]);
for i=1:9;
subplot(4,3,i)
plot(1:40, rand(40,1),'color',[rand(1) rand(1) rand(1)],'linewidth',2);
title(num2str([i]),'fontweight','bold');
end
subplot(4,3,i+1);image,axis tight;colorbar;
subplot(4,3,i+2);image,axis tight;colorbar
subplot(4,3,i+3);image,axis tight;
axshift;

Cite As

paul koch (2024). axshift (https://www.mathworks.com/matlabcentral/fileexchange/23680-axshift), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0.0