Hello Everyone,
I am working with the line plot and I want two different scales on X axis, like I want my plot start at 0 to 16 with 1 unit scale (i.e. 1,2,3,4,...,16). From point 17, I want scale to be 400 units up to 6000(i.e. 416, 816, 1216,...,6016).
Currently my plot has scale of 1 unit, i.e. 1,2,3,...,31.
Is there any command which can give me the scale which I want. 1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,416,816,1216,1616,2016,2416,2816,3216,3616,4016,4416,4816,5216,5616,6016.
Any help would be appreciate.
Thank you.

댓글 수: 2

dpb
dpb 2016년 7월 11일
You actually want the scale changed, or just the labels at the same points without changing the actual distance on the plot?
Darshan Patel
Darshan Patel 2016년 7월 12일
Hello,
I just want to change the labels at same points without affecting the plot. Basically instead of 17 I want 416, instead of 18 I want 816 and so on.

댓글을 달려면 로그인하십시오.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2016년 7월 11일

0 개 추천

x=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,416,816,1216,1616,2016,2416,2816,3216,3616,4016,4416,4816,5216,5616,6016]
y=sin(x)
xx=1:numel(x)
plot(xx,y)
xt=set(gca,'xtick',xx,'xticklabel',arrayfun(@(x) num2str(x),x,'un',0))

댓글 수: 1

Darshan Patel
Darshan Patel 2016년 7월 12일
Thanks a lot. It did work on the scale but I don't know, I am getting an error saying that "One or more arguments are not assigned during the call 'set'". I do not know what does that mean. Would be great if you can tell me about this.
Thank you in advance.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

질문:

2016년 7월 11일

댓글:

2016년 7월 12일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by