From: Ross W on 13 Aug 2010 05:15 "Johannes Buechler" <jb_spam(a)gmx.DELnet> wrote in message <i42u09$r2e$1(a)fred.mathworks.com>... > "Ross W" <rosswoodskiwi(a)hotmail.com> wrote in message <i41lij$ce8> Now you need to know where both your axes are located with respect to the figure, as well as where the legend and annotation are with respect to their axes. > > > > ax11Pos=get(ax11,'Pos'); > > annPos=get(LegendShadow ,'Pos'); > > > > Do you see what to do now? > > If I get you right, you suggest using an additional annotation box that replaces the original legend? > That'd mean a lot of additional work - or did I get you wrong? > > If not: The position issue already works perfectly, the shadow box appears exactly where I want it, only it appears on top of the legend (thus hiding it for the most part) instead of behind. > > Thanks, > > Johannes hi no i misunderstood - sorry. to reverse plotting order of objects in figure, change the order of the children e.g. %get the list of children ch=get(gcf,'children'); %reverse the order set(gcf,'children',ch(end:-1:1)) Ross
From: Johannes Buechler on 13 Aug 2010 10:31 "Ross W" <rosswoodskiwi(a)hotmail.com> wrote in message > to reverse plotting order of objects in figure, change the order of the children > > e.g. > %get the list of children > ch=get(gcf,'children'); > %reverse the order > set(gcf,'children',ch(end:-1:1)) I see - however I did not manage to successfully reverse the display order of the legend and the annotation. If I reverse the whole thing, only the annotation is displayed and the legend is invisible (probably disappears behind the graph background or something). So I tried exchanging the order of the first two elements only, and afterwards the last two elements only, but both leads to no effect at all. I thought this should work since the annotation is added at the very end to the plot and the legend is created right before. But it's not such a big deal, it'd just be nice to have the shadow as in Origin (which I want to replace by Matlab) it is currently present in the plots and my intention is to have them look quite alike. best regards Johannes
From: Ross W on 13 Aug 2010 18:38
"Johannes Buechler" <jb_spam(a)gmx.DELnet> wrote in message <i43kvp$aso$1(a)fred.mathworks.com>... > "Ross W" <rosswoodskiwi(a)hotmail.com> wrote in message > > to reverse plotting order of objects in figure, change the order of the children > > > > e.g. > > %get the list of children > > ch=get(gcf,'children'); > > %reverse the order > > set(gcf,'children',ch(end:-1:1)) > > I see - however I did not manage to successfully reverse the display order of the legend and the annotation. If I reverse the whole thing, only the annotation is displayed and the legend is invisible (probably disappears behind the graph background or something). So I tried exchanging the order of the first two elements only, and afterwards the last two elements only, but both leads to no effect at all. > > I thought this should work since the annotation is added at the very end to the plot and the legend is created right before. > > But it's not such a big deal, it'd just be nice to have the shadow as in Origin (which I want to replace by Matlab) it is currently present in the plots and my intention is to have them look quite alike. > > best regards > > Johannes Hi a tricky one, because the axes containing the annotation is not readily visible (I hadn't thought of that). that's why you got no results in spite of doing the right thing. this worked for me: set(get(LegendShadow,'parent'),'handlevisibility','on') %make the axes handle visible ch=get(gcf,'ch'); set(gcf,'ch',ch([2 1 3])) %change the stacking order at the end i had a shadow border around the legend Ross |