|
On Sep 18, 7:16=A0pm, Walter Roberson <rober...@hushmail.com> wrote:
> Aaron Fude wrote:
> > The subplot help states that invoking subplot(m, n, p) deletes the
> > contents and I have found myself unable to add to a subplot without
> > deleting the contents. How does one do it?
> >> help subplot
>
> =A0 =A0 If a SUBPLOT specification causes a new axis to overlap an
> =A0 =A0 existing axis, the existing axis is deleted - unless the position
> =A0 =A0 of the new and existing axis are identical. =A0For example,
> =A0 =A0 the statement SUBPLOT(1,2,1) deletes all existing axes overlappin=
g
> =A0 =A0 the left side of the Figure window and creates a new axis on that
> =A0 =A0 side - unless there is an axes there with a position that exactly
> =A0 =A0 matches the position of the new axes (and 'replace' was not speci=
fied),
> =A0 =A0 in which case all other overlapping axes will be deleted and the
> =A0 =A0 matching axes will become the current axes.
>
> > =A0(E.g. on a figure that was
> > obtained with the help of an open() command.)
> >> help subplot
>
> =A0 =A0 SUBPLOT('position',[left bottom width height]) creates an
> =A0 =A0 axis at the specified position in normalized coordinates (in
> =A0 =A0 in the range from 0.0 to 1.0).
>
> So if you have an existing axis that you want to match the position of,
> you can get() and record the Units of that existing axes, set() the Units=
to
> 'normalized', get() and record the Position of the existing axes,
> set() the Units of the existing axes back to the recorded Units. The
> recorded position could then be passed to subplot(). On the other hand,
> doing that would just amount to doing the same thing as using axes() to
> make the existing axes the "current" axes.
>
> So... why not just findobj(TheFigureHandle, 'Type', 'axes') or something
> similar to find the -existing- axes, and make that existing axes the
> current axes ??
How do you get the existing axis from a particular subplot? Not sure
what to call get() on. And then how do you make the obtained axes the
current axes? I know how to get them but not how to set them.
|