Prev: Skip lines in a for loop
Next: multiple legends
From: us on 12 Jul 2010 18:29 dpb <none(a)non.net> wrote in message <i1g16m$poo$1(a)news.eternal-september.org>... > us wrote: > ... > > > duane, which ML ver do you have(?)... > > ver 2010a requires this procedure > > > > plot(rand(10,3)); > > lh=legend({'a','bb','ccc'},'location','southwest'); > > axes(lh); > > title('not a legend title','fontweight','bold'); > > set(get(lh,'title'),'string','a legend','fontweight','bold'); > > > > us > > I'm still in dark ages w/ R12 (v6)... :( (That was about the time I > retired from active consulting) > > What happens w/ lastest version w/ the the title() pointed at the legend > axis handle out of curiosity? > > -- it puts the title on top of the axis created/used by the PLOT command... us
From: dpb on 12 Jul 2010 21:20 us wrote: > dpb <none(a)non.net> wrote in message > <i1g16m$poo$1(a)news.eternal-september.org>... .... >> What happens w/ lastest version w/ the the title() pointed at the >> legend axis handle out of curiosity? .... > it puts the title on top of the axis created/used by the PLOT command... > > us You mean it's attached to that axis handle instead of hLegend? That's simply bizarro if so... The default position of upper right physically drew the title above the bounding box in R12 but it was definitely attached to the legend handle 'cuz it moved w/ it when drug by moose... --
From: John on 13 Jul 2010 17:16 dpb <none(a)non.net> wrote in message <i1g16m$poo$1(a)news.eternal-september.org>... > us wrote: > ... > > > duane, which ML ver do you have(?)... > > ver 2010a requires this procedure > > > > plot(rand(10,3)); > > lh=legend({'a','bb','ccc'},'location','southwest'); > > axes(lh); > > title('not a legend title','fontweight','bold'); > > set(get(lh,'title'),'string','a legend','fontweight','bold'); > > > > us > > I'm still in dark ages w/ R12 (v6)... :( (That was about the time I > retired from active consulting) > > What happens w/ lastest version w/ the the title() pointed at the legend > axis handle out of curiosity? > > -- AWESOME. This works EXACTLY like i want it to. 1) plot your data 2) set a handle to your legend i.e. legend_handle1 = legend(...) 3) set(get(legend_handle1,'title'),'string','Text for Title',...) Beautiful.
From: dpb on 13 Jul 2010 22:48 John wrote: > dpb <none(a)non.net> wrote in message > <i1g16m$poo$1(a)news.eternal-september.org>... >> us wrote: >> ... >> >> > duane, which ML ver do you have(?)... >> > ver 2010a requires this procedure >> > > plot(rand(10,3)); >> > lh=legend({'a','bb','ccc'},'location','southwest'); >> > axes(lh); >> > title('not a legend title','fontweight','bold'); >> > set(get(lh,'title'),'string','a legend','fontweight','bold'); >> > > us >> >> I'm still in dark ages w/ R12 (v6)... :( (That was about the time I >> retired from active consulting) >> >> What happens w/ lastest version w/ the the title() pointed at the >> legend axis handle out of curiosity? >> >> -- > > AWESOME. This works EXACTLY like i want it to. 1) plot your data > 2) set a handle to your legend i.e. legend_handle1 = legend(...) > 3) set(get(legend_handle1,'title'),'string','Text for Title',...) That works in R12, as well, but axes(lh) title('Text for Title') does the identical in (imo) less-convoluted manner. You're saying this doesn't do that in later versions but still attaches the title to the main axis? That seems a bug if so. --
From: us on 14 Jul 2010 03:17
dpb <none(a)non.net> wrote in message <i1j8ms$c48$1(a)news.eternal-september.org>... > John wrote: > > dpb <none(a)non.net> wrote in message > > <i1g16m$poo$1(a)news.eternal-september.org>... > >> us wrote: > >> ... > >> > >> > duane, which ML ver do you have(?)... > >> > ver 2010a requires this procedure > >> > > plot(rand(10,3)); > >> > lh=legend({'a','bb','ccc'},'location','southwest'); > >> > axes(lh); > >> > title('not a legend title','fontweight','bold'); > >> > set(get(lh,'title'),'string','a legend','fontweight','bold'); > >> > > us > >> > >> I'm still in dark ages w/ R12 (v6)... :( (That was about the time I > >> retired from active consulting) > >> > >> What happens w/ lastest version w/ the the title() pointed at the > >> legend axis handle out of curiosity? > >> > >> -- > > > > AWESOME. This works EXACTLY like i want it to. 1) plot your data > > 2) set a handle to your legend i.e. legend_handle1 = legend(...) > > 3) set(get(legend_handle1,'title'),'string','Text for Title',...) > > That works in R12, as well, but > > axes(lh) > title('Text for Title') > > does the identical in (imo) less-convoluted manner. > > You're saying this doesn't do that in later versions but still attaches > the title to the main axis? That seems a bug if so. > > -- -or- maybe a change in the graphics handle engine... ver 2010a yields plot(1:2); lh=legend('a'); % now handle(gca) % <- does HANDLE exist in your ML ver(?)... % ans = axes get(lh,'type') % ans = axes handle(lh) % ans = scribe.legend % <- what do you get in your ML ver(?)... us |