From: Lorenzo Guerrasio on 12 Feb 2010 05:17 Hi, I'm struggling to do a very simple thing: I have a figure, than I have to open a second figure plot a box plot:on this second figure I want to overplot two lines connecting the two medians of the box plot. This is done in a routine for several experiments.The problem is that if I run the routine freely, plots just go crazy, lines will be plot on the previous figure or delete the boxplot.Any idea?Here is the code: figure(z*2-1)%the first figure hold on [code] hold off figure(z*2)%%2nd fig: if I place a break point here,everthings work (!?) boxplot(data,group,'positions',[0,.5,1,1.5],'notch','on','colors','krkkbk','symbol','b.');%colors:1wisker 2box 3median hold on ax=get(figure(z*2),'CurrentAxes'); plot([0,1],[median(lat_neg_ctrl),median(lat_pos_ctrl)],'-.b','linewidth',1,'marker','o') plot([0.5,1.5],[median(lat_neg_musci),median(lat_pos_musci)],'-.g','linewidth',1,'marker','o') hold off
From: Lorenzo Guerrasio on 12 Feb 2010 06:13 Sorry,I have to up it because of this massive spam attack... "Lorenzo Guerrasio" <lorenzo.guerrasio(a)email.it> wrote in message <hl39qu$qho$1(a)fred.mathworks.com>... > Hi, I'm struggling to do a very simple thing: > I have a figure, than I have to open a second figure plot a box plot:on this second figure I want to overplot two lines connecting the two medians of the box plot. > This is done in a routine for several experiments.The problem is that if I run the routine freely, plots just go crazy, lines will be plot on the previous figure or delete the boxplot.Any idea?Here is the code: > > > figure(z*2-1)%the first figure > hold on > [code] > hold off > > figure(z*2)%%2nd fig: if I place a break point here,everthings work (!?) > > boxplot(data,group,'positions',[0,.5,1,1.5],'notch','on','colors','krkkbk','symbol','b.');%colors:1wisker 2box 3median > hold on > ax=get(figure(z*2),'CurrentAxes'); > plot([0,1],[median(lat_neg_ctrl),median(lat_pos_ctrl)],'-.b','linewidth',1,'marker','o') > plot([0.5,1.5],[median(lat_neg_musci),median(lat_pos_musci)],'-.g','linewidth',1,'marker','o') > hold off
|
Pages: 1 Prev: Simulink input parameters Next: alcohol withdrawal scale |