Prev: Axis spacing in matlab
Next: datenum performance
From: Camille Couzi on 10 Aug 2010 17:07 Hi, I am creating a GUI which has 4 subplots: sub1=subplot(2,2,1); sub2=subplot(2,2,2); sub3=subplot(2,2,3); sub4=subplot(2,2,4); I want to link these subplots like that: - sub1 is linked 'xy' with sub2 - sub3 is linked 'xy' with sub4 - sub1 is linked 'x' with sub3. The problem is that if I write: linkaxes([sub1 sub2],'xy') linkaxes([sub3 sub4],'xy') linkaxes([sub1 sub3],'x') Then matlab only takes the last linkedaxes command, ie linkaxes([sub1 sub3],'x') . How can I make all my linked axes? is that possible? I have tried with linkprop but I don't know if that would run... Thank you in advance for your help, I can't go through this problem alone... Camille.
From: Steven_Lord on 10 Aug 2010 17:17 "Camille Couzi" <camillecouzi(a)yahoo.fr> wrote in message news:i3sf1o$t98$1(a)fred.mathworks.com... > Hi, > I am creating a GUI which has 4 subplots: > sub1=subplot(2,2,1); > sub2=subplot(2,2,2); > sub3=subplot(2,2,3); > sub4=subplot(2,2,4); > > I want to link these subplots like that: > - sub1 is linked 'xy' with sub2 > - sub3 is linked 'xy' with sub4 > - sub1 is linked 'x' with sub3. > > The problem is that if I write: > linkaxes([sub1 sub2],'xy') > linkaxes([sub3 sub4],'xy') > linkaxes([sub1 sub3],'x') > > Then matlab only takes the last linkedaxes command, ie linkaxes([sub1 > sub3],'x') . That is correct, and that is the documented behavior; see the Note box in the Remarks section of the reference page for LINKAXES. http://www.mathworks.com/access/helpdesk/help/techdoc/ref/linkaxes.html > How can I make all my linked axes? is that possible? I have tried with > linkprop but I don't know if that would run... You could _try_ linking sub1 and sub2 together with LINKAXES, sub3 and sub4 together with LINKAXES, and follow up with LINKPROP to perform the partial linkage between sub1 and sub3. I haven't tried this, but it may work. -- 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
From: Camille Couzi on 10 Aug 2010 17:43 Hi Mr Lord, Thanks for your quick reply. I have read again the linkaxes and linkprop reference pages, and in fact, my problem is more complicated than the one I put in my first message (I put this simplified example to know what were the possibilities, but it is better if I write here my real script: I have in fact 5subplots: h.cp1=subplot(5,3,[1 2 4 5]); h.prof1=subplot(5,3,[3 6]); h.cp2=subplot(5,3,[7 8 10 11]); h.prof2=subplot(5,3,[9 12]); h.cp_aux=subplot(5,3,[13 14]); They are positioned like that: ------------------------------------------------------ | cp1 prof1 | | cp2 prof2 | | cp_aux | ----------------------------------------------------- The links I need are these: - cp1 and cp2: 'xy' - cp1 and prof1 : 'y' - cp2 and prof2: 'y' - cp1,cp2 and cp_aux: 'x' Has anyone an idea of how to do that? Thank you very very much Camille.
From: Camille Couzi on 11 Aug 2010 09:03 "Camille Couzi" <camillecouzi(a)yahoo.fr> wrote in message <i3sf1o$t98$1(a)fred.mathworks.com>... > Hi, > I am creating a GUI which has 4 subplots: > sub1=subplot(2,2,1); > sub2=subplot(2,2,2); > sub3=subplot(2,2,3); > sub4=subplot(2,2,4); > > I want to link these subplots like that: > - sub1 is linked 'xy' with sub2 > - sub3 is linked 'xy' with sub4 > - sub1 is linked 'x' with sub3. > > The problem is that if I write: > linkaxes([sub1 sub2],'xy') > linkaxes([sub3 sub4],'xy') > linkaxes([sub1 sub3],'x') > > Then matlab only takes the last linkedaxes command, ie linkaxes([sub1 sub3],'x') . > > How can I make all my linked axes? is that possible? I have tried with linkprop but I don't know if that would run... > > Thank you in advance for your help, I can't go through this problem alone... > > Camille. Any idea?... please!!! Thank you very much
|
Pages: 1 Prev: Axis spacing in matlab Next: datenum performance |