Change number of xlabel ticks to show
조회 수: 1 (최근 30일)
이전 댓글 표시
I have x and y matrices, but I only want a few points to show ( i.e. 3 labels out of the 10 data points.
X = 0:Depth/((binnum*3)-1):Depth;
Y = 0:H/(binnum-1):H;
I only want a few of the points to show:
[ 0.........half..........Depth] etc
댓글 수: 0
답변 (1개)
MHN
2016년 3월 4일
I have not get the question completely, if you want to plot just some points, you can just compute those points! otherwise you can do the following
X = -5:0.01:5;
Y = 2*X.^3-3*X.^2+X;
X_desire = [X(X==-5), X(X==0), X(X==5)];
Y_desire = [Y(X==-5), Y(X==0), Y(X==5)];
plot(X_desire, Y_desire, 'o')
If you want to just put a few label on your plot then
X = -5:0.01:5;
Y = 2*X.^3-3*X.^2+X;
plot(X, Y)
set(gca, 'XTick', [-5, 0, 5])
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Axis Labels에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!