I WANT TO EXTEND MY GRAPH WITHOUT DISTURBING THE MATRIX PLOT
조회 수: 3 (최근 30일)
이전 댓글 표시
I AM PLOTTING A DATA MATRIX X--- plot(X) DUE TO WHICH I AM GETTING THE FOLLOWING GRAPH
X= [-1.961 -1.527 -0.194 -1.475 -1.023 -0.188 -2.255 -1.482 -1.156 -0.150 -1.121 -0.772 -0.145 -1.709 ..... 21.297 15.975 3.164 20.255 12.603 3.304 28.146 21.848 16.397 3.259 20.872 12.974 3.408 28.946];
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150972/image.jpeg)
I want to change the x-axis from -5 to 400. but when i try to change it the x-axis plot from 0 to 45 is retained while the rest is left blank.
What i want is this;
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150973/image.jpeg)
If i change the axis for the plot using axis([0 400 0 30]),i am getting a compressed version;see below image
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/150975/image.jpeg)
I want the graph to stretch to the limit of 400 without disturbing the graph. Please somebody help...
댓글 수: 1
sixwwwwww
2013년 10월 21일
Can you share your code please so that it can be looked at because currently plot(X) doesn't plot the graph you showing your first figure
채택된 답변
Pourya Alinezhad
2013년 10월 21일
the x vector you mentioned actually goes through the y axis... and in the black and white graph the x axis have a rank from 1 to 400. you should define an other vector (for example xx) and re plot like this plot(xx,x) in which the xx contains length(x) values (same lengths as x) .xx=[0 1 5 10 15 20 80 100 150 200 250 .... 400];
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Line Plots에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!