Why does Matlab give an error for axes?

Did anybody know why does Matlab give an error for axes?
Warning: line XData length (2) and YData length (0) must be equal
Thx, Sven_sight

4 Comments

Are you using axes or axis? Please post the code that is giving the error.
Posting the small relevant part of the code, which reproduces the problem, would be helpful.
sven_sight
sven_sight on 30 Aug 2012
Edited: sven_sight on 30 Aug 2012
I've using both axes and axis. The process run smoothly but in the end the warning sign appears.
figure(1); width=0.38; height=0.35; h1=axes('position',[0.6 .55 width height],'box','on','xcolor','k','ycolor',... 'k'); set(gcf,'color', 'w')
inputv=Q22; qstart=min(inputv); qstop=max(inputv); axes(h1); axis([qstart qstop min(Q44) max(Q44)]);
Thanks,
The plot(X,Y) command might also be informative, as well as the sizes of X and Y. I may be missing something, but I don't see an error in what you've posted.

Sign in to comment.

 Accepted Answer

Sean de Wolski
Sean de Wolski on 30 Aug 2012
Edited: Sean de Wolski on 30 Aug 2012
It's not a warning for the axes, it's a warning for the line and it means exactly what it says! You can't have a line with two xdata and three ydata since they don't line up!
Consider this:
plot(1:10,1:12)
It doesn't work for the same reason.

More Answers (0)

Categories

Find more on 2-D and 3-D Plots in Help Center and File Exchange

Products

Tags

Community Treasure Hunt

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

Start Hunting!