From: us on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i39gds$jmi$1(a)fred.mathworks.com>...
> Dear us,
>
> > plot(1:10);
> > ah=copyobj(gca,gcf);
> > set(ah,'xaxislocation','top','yaxislocation','right');
>
> And:
> set(ah, 'color', 'none');
> Otherwise the lower axes is concealed.
>
> Kind regards, Jan
>
> PS. Of course I've thought twice before posting this.

:-)
OR: see next reply...
:-)

urs
From: us on
"George " <tua16365(a)temple.edu> wrote in message <i39gjg$1kn$1(a)fred.mathworks.com>...
> "us " <us(a)neurol.unizh.ch> wrote in message
> > one of the solutions
> >
> > plot(1:10);
> > ah=copyobj(gca,gcf);
> > set(ah,'xaxislocation','top','yaxislocation','right');
> >
> > us
>
> That does work, however it creates a problem in my GUI.
>
> I have an underlying matrix of data that is plotted on an axes, then a transparent axes (A2) plotted on top of the data. A user can draw lines on this transparent axes to collect data points from the underlying matrix. Using the copyobj to make a new axes layer gets in the way of the drawing mechanism.
>
> I tried using the axes 'Layer' property to see if i could push the new axes (ah) beneath the other axes, but it did not work.

one of the solutions

plot(1:10);
ah=copyobj(gca,gcf);
set(ah,'xaxislocation','top','yaxislocation','right','color',[1,0,0]); % <- for jan...
disp('cont with any key...');
pause;
uistack(ah,'bottom');

us
From: George on
"Jan Simon" <matlab.THIS_YEAR(a)nMINUSsimon.de> wrote in message <i39hjd$5m3$1(a)fred.mathworks.com>...
> Dear George,
>
> > I have an underlying matrix of data that is plotted on an axes, then a transparent axes (A2) plotted on top of the data. A user can draw lines on this transparent axes to collect data points from the underlying matrix. Using the copyobj to make a new axes layer gets in the way of the drawing mechanism.
>
> You can set the 'HandleVisibility' of the copied axes object to 'off'. Then this axes does not get the user's input, but is visible and shows the additional tick labels.
>
> Kind regards, Jan

Jan,

Changing the 'HandleVisibility' worked! Thank you very much.

I'm still curious though, isn't there any other way to accomplish this without, essentially, creating another axes? I can change my code to deal with another axes, but if i do not have to, that would be great.
From: Jan Simon on
Dear George,

> I'm still curious though, isn't there any other way to accomplish this without, essentially, creating another axes? I can change my code to deal with another axes, but if i do not have to, that would be great.

You can remove the original tick labels and replace them by manually created ones. Look in the FEX for "rotate tick" to get some function for rotated tick labels. You can expand these ideas to place the lables on both sides.

Kind regards, Jan
First  |  Prev  | 
Pages: 1 2
Prev: Excel Question
Next: Contour in a 3D domain