0

I am drawing a plot for a set of data, including a boxplot and a polyfit plot, but when I drew it, they had two different axies so that I could not compare them. How could I combine these two plots and make them into the same axies? (For example, move boxplot starting at 0) Thanks a lot!

enter image description here

....
figure(1)

f=polyfit(selectedKhwv,DiffVesKhwv,n);
x= min(selectedKhwv):0.001:max(selectedKhwv);
y=vpa(poly2sym(f),10);
y=vectorize(y);
y=eval(y);

plot(x,y,'-r');
hold on;

boxplot(DiffVesKhwv,selectedKhwv);
axis([0,14,-6,8]);
kimdai
  • 1
  • 2
  • 1
    have you tried linkaxes? http://www.mathworks.com/help/matlab/ref/linkaxes.html. Or make a call to axis([]) after drawing both plots? – Benoit_11 Dec 03 '14 at 20:50
  • 1
    what commands are you using for this plot? – Shai Dec 03 '14 at 20:57
  • Normally you can set the x values for plots, using some extra argument. I would be easier for us to understand what happens if you provides some commands and maybe an image the x-axis is easier to read. – patrik Dec 04 '14 at 09:43

0 Answers0