Azzera filtri
Azzera filtri

The plot disappears if I change xlim

3 visualizzazioni (ultimi 30 giorni)
Nik Sam
Nik Sam il 1 Giu 2016
Commentato: Nik Sam il 1 Giu 2016
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.

Risposte (1)

Adam
Adam il 1 Giu 2016
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 Commenti
Steven Lord
Steven Lord il 1 Giu 2016
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 il 1 Giu 2016
ITS OK..I FOUND IT...
But thanks very much Adam

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by