Y double axis plot
Show older comments
Below y double axis has the error of "Dimensions of matrices being concatenated are not consistent".
x = [162 132 190 470 187 157 215 495 165 135 193 473 302 272 330 610 942 912 970 1250];
y1 = [1 1.273; 0.636 0.751; 0.247 0.287; 0.267 0.32; 0.268 0.311; 0.33 0.407; 0.266 0.389; 0.768 1.22; 0.21 0.522; 0.187 0.173, 0.085 0.111; 0.031 0.038; 0.189 0.221; 0.134 0.129; 0.051 0.04; 0.0538 0.083; 0.21 0.268; 0.121 0.146; 0.058 0.072; 0.0552 0.066;];
y2 = [4271 263 110 1364 1375 10 51 6 13740 1805 229 19 932 3 3 9 1 3 1 7];
figure('Color','w')
[hAx,hLine1,hLine2] = plotyy(x,y1,x,y2);
xlabel ('H value(USD)')
ylabel(hAx(1),'P value (m)') % left y-axis
ylabel(hAx(2),'T value (s)') % right y-axis
grid on
Y2axis right
ax.Ylable(hAx(2)).Color = 'r';
Accepted Answer
More Answers (0)
Categories
Find more on Axis Labels in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


