dpb <email@example.com> wrote in message <firstname.lastname@example.org>... > On 4/20/2013 2:24 AM, Murat wrote: > > Hi. I am new in Matlab and i have a problem having plotting 3 'Y' axes > > with one of the Y axes are common with two variable. it's like 4 > > variable as in the image. How can i get the true code? Please help me out. > > http://img401.imageshack.us/img401/1750/3yaxeswith2common.png > > See doc under 'Graphics -- Objects -- Axes Properties' there's a topic > titled "Using Multiple X= and Y-Axes" > > From its example modified slightly... > > x1 = [0:.1:40]; > y1 = 4.*cos(x1)./(x1+2); > x2 = [1:.2:20]; > y2 = x2.^2./x2.^3; > > >> hl1 = line(x1,y1,'Color','r'); > ax1 = gca; > set(ax1,'XColor','r','YColor','r') > > pos_ax1 = get(ax1,'Position'); % get the position vector 1st axis > % set the left position for another; make width so right sides match... > pos_ax2=pos_ax1; pos_ax2(1)=0.25; > pos_ax2(3)=pos_ax1(3)+pos_ax1(1)-pos_ax2(1); > % Now add another... > ax2 = axes('Position',pos_ax2,... > 'XAxisLocation','bottom',... > 'YAxisLocation','left',... > 'Color','none',... > 'XColor','k','YColor','k'); > > > Salt to suit... > > --
Thank you very much for your attention. i solved this problem with plot4y in file exchange page.