From: Ken on 26 Mar 2010 09:17 This is weird, I got this for the scatter plot even though for a single point: [ax, h1, h2] = plotyy(x,y1, x,y2); hold all; scatter(ax, x(1), y(1), '*'); hold off; It give me the following error: "X and Y must be vectors of the same length."
From: dpb on 26 Mar 2010 09:23 Ken wrote: > This is weird, I got this for the scatter plot even though for a single > point: > > [ax, h1, h2] = plotyy(x,y1, x,y2); > hold all; > scatter(ax, x(1), y(1), '*'); > hold off; > > It give me the following error: > > "X and Y must be vectors of the same length." doc scatter Why are you including the handle vector (length 2) from plotyy? --
From: Ken on 26 Mar 2010 09:31 Thanks. I like to plot it on the same graph, not on a new graph. Is there any other way to do it? dpb <none(a)non.net> wrote in message <hoiciu$mn7$1(a)news.eternal-september.org>... > Ken wrote: > > This is weird, I got this for the scatter plot even though for a single > > point: > > > > [ax, h1, h2] = plotyy(x,y1, x,y2); > > hold all; > > scatter(ax, x(1), y(1), '*'); > > hold off; > > > > It give me the following error: > > > > "X and Y must be vectors of the same length." > > doc scatter > > Why are you including the handle vector (length 2) from plotyy? > > --
From: dpb on 26 Mar 2010 09:45 Ken wrote: > Thanks. I like to plot it on the same graph, not on a new graph. > Is there any other way to do it? hold on will retain last current axis and add doc axes to set a given axis as current. I can't tell from your comment whether you grok that scatter() doesn't accept an axis handle as an argument or not but to be clear at least in my version it doesn't... BTW, please don't top post -- it makes following conversation more difficult than otherwise needs to be. --
From: Ken on 26 Mar 2010 10:21
hi, Thanks. The problem is as stated above. scatter tries to plot the graph on a separate window no matter what I do to plot it on the same one. Do you know how do I plot the on the top of an existing graph some points? Any simple examples would be fine especially with plotyy or the line plots with multiple axes(2 y axes and 2 x axes on the same graph). I can plot those graphs with multiple axes, but i want to highlight some points on the top of it, it just doesn't work. Either it erases the previous graph or plot it on a new graph. Thanks, -ken dpb <none(a)non.net> wrote in message <hoidst$tfn$1(a)news.eternal-september.org>... > Ken wrote: > > Thanks. I like to plot it on the same graph, not on a new graph. > > Is there any other way to do it? > > hold on > > will retain last current axis and add > > doc axes > > to set a given axis as current. > > I can't tell from your comment whether you grok that scatter() doesn't > accept an axis handle as an argument or not but to be clear at least in > my version it doesn't... > > BTW, please don't top post -- it makes following conversation more > difficult than otherwise needs to be. > > -- |