Problem With Axis Limits
조회 수: 7 (최근 30일)
이전 댓글 표시
Hello all,
First post here but have found many a solution previously so keep up the good work!
I am working on a Script that produces various loads exerted on a Gearbox and am running into some issues with my plots.
I am plotting both Shear Force and Bending Moment in the same graph which is working perfectly fine with the only issue being that MATLAB sets my maximum x-axis value at 0.45m whereas the shaft is only 0.411m. If I use either axis (ymin ymax 0 0.411) or xlim (0 0.411) or ANY value below the 0.45 default, MATLAB shrinks the entire graph to fit between those values rather than just cutting off the empty space. If someone could tell me what I am doing wrong that would be great!
Code:
figure (1);
hold on;
set (figure (1), 'outerposition', [390 50 750 750]);
set (gca, 'units', 'normalized', 'position', [0.125, 0.125, 0.75, 0.75])
[ax, p1, p2] = plotyy (x_V, V_Y, x_M, M_Y);
plot (x_M, M_Yo, 'r--')
xlim ([0 0.411];
title ({'Shear Force & Bending Moment' ; '[Y-Plane]'});
xlabel ({'Distance From Bearing 1' ; '[m]'});
ylabel (ax(1),{'Shear Force' ; '[N]'});
ylabel (ax(2),{'Bending Moment' ; '[Nm]'})
hold off;
댓글 수: 0
답변 (1개)
Star Strider
2015년 11월 28일
I can’t run your code so only offer a few things for you to experiment with:
axis tight
axis equal
댓글 수: 4
Star Strider
2015년 11월 29일
It could be. This is just my current hypothesis.
To upload the figure as an image, first use the floppy-disk icon in the figure window to save the plotted figure as a .png image. Then back here in MATLAB Answers, use the brown-framed green landscape icon to upload the image. Be sure to complete both the ‘Choose file’ and ‘Insert image’ steps.
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating, Deleting, and Querying Graphics Objects에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!