Problem with plotting a 2D graph
조회 수: 1 (최근 30일)
이전 댓글 표시
Hi :) ,
I have problem when I plot a graph. The graph goes from right to left ! while it should go from left to right . That means my X-axis is reversed. When I tick the Reverse box for the X-axis in the axis properties, it goes on the right way ( from left to right ).
But the problem is that when I plot any graph again, it goes from right to left again :( .
How can I make it always goes from left to right !!
Thanks for reading and your help is appreciated ^_^ .
H.MBK
댓글 수: 0
답변 (2개)
Star Strider
2014년 4월 3일
set(gca,'XDir','reverse')
댓글 수: 5
Star Strider
2014년 4월 3일
Thank you for uploading the plots.
It is plotting correctly, with monotonically-increasing values of Input on the x-axis. If you want the axes reversed, you have to add:
set(gca,'XDir','reverse')
in each plot in which you want them reversed, as I mentioned originally.
Dishant Arora
2014년 4월 3일
get(gca,'Xdir') % see what it says, it must be reversed
set(gca,'Xdir','normal') % sets the axis back to normal
댓글 수: 4
Image Analyst
2014년 4월 4일
편집: Image Analyst
2014년 4월 4일
Please mark the best Answer as "Accepted". You can only "Accept" one.
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!