The plot disappears if I change xlim

조회 수: 5 (최근 30일)
Nik Sam
Nik Sam 2016년 6월 1일
댓글: Nik Sam 2016년 6월 1일
Hello,
I have this simple example
K =
0.0000 0.5527
0.0003 0.4017
0.0040 0.2707
0.0210 0.1480
0.0646 0.0646
When I run plot(K) my graph is wrong. If I change the view like view([90 -90]) then I have the right plot.But now the axes is wrong and I have y as x.
First, can I avoid this command (view([90 -90])) and get immediately the right plot?
Second, if i try to change xlim plot disappears.Why this happens? In fact I want to change y limits to be from 0 to 1.

답변 (1개)

Adam
Adam 2016년 6월 1일
plot( x, y )
is the normal form of the plot function so just use that as e.g.
plot( K(:,2), K(:,1) )
if you want the 2nd column on the x axis and the first on the y axis.
Personally I would always use the form with an explicit axes handle too, but that is a side issue!
  댓글 수: 3
Steven Lord
Steven Lord 2016년 6월 1일
Please post the exact code you used to create the plots and attach pictures from before and after changing the Y axis limits demonstrating the plot "disappearing." The button with a picture on it between the link of chain and the paper clip lets you attach images to your comment or answer.
Nik Sam
Nik Sam 2016년 6월 1일
ITS OK..I FOUND IT...
But thanks very much Adam

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

카테고리

Help CenterFile Exchange에서 Line Plots에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by