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 commentaires

Star Strider
Star Strider le 30 Août 2012
Are you using axes or axis? Please post the code that is giving the error.
Jan
Jan le 30 Août 2012
Posting the small relevant part of the code, which reproduces the problem, would be helpful.
sven_sight
sven_sight le 30 Août 2012
Modifié(e) : sven_sight le 30 Août 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,
Star Strider
Star Strider le 30 Août 2012
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.

Connectez-vous pour commenter.

 Réponse acceptée

Sean de Wolski
Sean de Wolski le 30 Août 2012
Modifié(e) : Sean de Wolski le 30 Août 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.

Plus de réponses (0)

Catégories

En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by