From: Markus on
hello

i want to reference axes by a tag and then fill the plot with fill(). but after using fill() the tag of the axes is deleted as you can see in the example:

fig = figure(1);
ax = axes('Parent', fig, 'Tag', 'axTag', 'Units', 'characters', 'Position', [10 10 5 5]);

till now i still can reference the axes by the tag:

get(ax, 'Tag')
ans =
axTag

or:

get(gca, 'Tag')
ans =
axTag

but when i fill the plot with:

fill([0 0 1], [0 1 1], 'r')

get(ax, 'Tag') as well as get(gca, 'Tag') return
ans =
''

so why do i loose the tag then? how can i avoid that?
thx
From: us on
"Markus " <fdsa(a)gmx.ch> wrote in message <huvi8p$ctn$1(a)fred.mathworks.com>...
> hello
>
> i want to reference axes by a tag and then fill the plot with fill(). but after using fill() the tag of the axes is deleted as you can see in the example:
>
> fig = figure(1);
> ax = axes('Parent', fig, 'Tag', 'axTag', 'Units', 'characters', 'Position', [10 10 5 5]);
>
> till now i still can reference the axes by the tag:
>
> get(ax, 'Tag')
> ans =
> axTag
>
> or:
>
> get(gca, 'Tag')
> ans =
> axTag
>
> but when i fill the plot with:
>
> fill([0 0 1], [0 1 1], 'r')
>
> get(ax, 'Tag') as well as get(gca, 'Tag') return
> ans =
> ''
>
> so why do i loose the tag then? how can i avoid that?
> thx

one of the solutions

ax=axes('tag','atag');
hold on;
fill([0,0,1],[0,1,1],[1,0,0]);
get(ax,'tag');
% ans = atag

us
From: Steven Lord on

"Markus " <fdsa(a)gmx.ch> wrote in message
news:huvi8p$ctn$1(a)fred.mathworks.com...
> hello
>
> i want to reference axes by a tag and then fill the plot with fill(). but
> after using fill() the tag of the axes is deleted as you can see in the
> example:
>
> fig = figure(1);
> ax = axes('Parent', fig, 'Tag', 'axTag', 'Units', 'characters',
> 'Position', [10 10 5 5]);

*snip*

> but when i fill the plot with:
>
> fill([0 0 1], [0 1 1], 'r')
>
> get(ax, 'Tag') as well as get(gca, 'Tag') return
> ans =
> ''
>
> so why do i loose the tag then? how can i avoid that?

http://www.mathworks.com/support/solutions/en/data/1-168SX/?solution=1-168SX

High-level plotting functions, like PLOT and FILL, respond to the NextPlot
setting as described in that document.

--
Steve Lord
slord(a)mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
To contact Technical Support use the Contact Us link on
http://www.mathworks.com