Overlay Axes with Different Sizes

This example shows how to display the same set of data using different size axes.

Create a figure with five axes of different sizes by setting their Position properties. In each axes plot the sphere function.

figure
ax(1) = axes('Position',[0 0 1 1]);
sphere

ax(2) = axes('Position',[0 0 .4 .6]);
sphere

ax(3) = axes('Position',[0 .5 .5 .5]);
sphere

ax(4) = axes('Position',[.5 0 .4 .4]);
sphere

ax(5) = axes('Position',[.5 .5 .5 .3]);
sphere

Use the axes handles stored in array ax to turn off the display of the axes boxes so that only the spheres are visible.

set(ax,'Visible','off')

Using five axes of different sizes gives the effect that the spheres appear different shapes and sizes, even though each sphere is defined by the same data.

Was this topic helpful?