axes problem

2 次查看(过去 30 天)
Susan
Susan 2011-7-31
Hi,
I am experiencing difficulties with setting up the axes limit for two plots I want to have in one figure. I can do each independent from the other and it will work so I don't have issue with the actual code functionality, the problem comes when I want to plot them both in one graph. I read the cla, to clear the axes and plot the other one but this one got rid of the old axes completely.. My code is below and I would like to ask for assistant.. I am pretty sure my problem is with the setting up the limits in the axes, because for the estimate function it will not be the same limits as the current data I have it could need to exceed the limits either in the positive or negative side.. !
data = importdata('test.dat');
x = data(:,1);
hold on
X = (x).';
a= min(X);
b=max(X);
line(repmat(X,2,1),repmat([0;1],1,length(X)),'color','r' );
axis([a b 0 40]);
[xi,f]=ksdensity(X)
plot(f,xi)
  4 个评论
Jan
Jan 2011-8-1
@Susan: This is your 21th question here. So I suggest to follow the blue "? Markup" link on this page to learn more about using MATLAB Answers.
Walter Roberson
Walter Roberson 2011-8-1
The << >> markup has to be in a paragraph of its own, nothing else in the paragraph at all.
If you use imageshack the URL you are normally given will end with a slash. If you try to use << >> on that URL, it will not work. You need to display the image in another window, and left-click on the image myself and use "copy image location", and paste that URL in the << >> . Note: if the URL you get is an https:// URL instead of an http:// URL then you cannot use << >> successfully for it.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Data Exploration 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by