From: Ken on
Can anyone get back to me on this? Thanks.
"Ken " <kk61(a)cornell.edu> wrote in message <hobk91$180$1(a)fred.mathworks.com>...
> I am kinda stuck here...
> below is my matlab code:
>
> figure
> hold on
> ax1 = gca;
> hl1 = line(x,y,'Color','b');
>
> set(ax1,'XColor','b','YColor','b');
>
> ax2 = axes('Position',get(ax1,'Position'),...
> 'XAxisLocation','top',...
> 'YAxisLocation','right',...
> 'Color','none',...
> 'XColor','k','YColor','k');
>
> hl2 = line(x,z,'Color','k','Parent', ax2);
> hold off
>
> figure
> hold on;
> [ax, h1, h2] = plotyy(x,y, x,z);
> hold off;
>
> but when I like to shoe a couple points on both graphs with '*', I can't get it working? any suggestions?
>
>
From: Walter Roberson on
Ken wrote:

> Thanks. This doesn't work as scatter do generate another plot with the
> points.

Please post your comments *below* the material you are commenting on. It
makes it easier to follow the conversation. Do you prefer that your
books be printed from the last chapter to the first?

> I want to generate them on the same plot. It has to be on one of the two
> plots, either on plotyy or line graph... don't have to be on both. I put
> them both since I didn't get any of them working...

If you use the axis as the first argument, like I did in my sample code,
it is not possible for scatter to create a new figure to draw the points on.

>> In general, to add points, I would suggest you use
>> scatter(ax1, pointx, pointy, '*')
>> scatter(ax(1), pointx, pointy, '*')

> Let me know if you got a solution for it asap...

Even I have to sleep sometime!
From: Ken on
Thanks Walter,

Any solutions for this?

> If you use the axis as the first argument, like I did in my sample code,
> it is not possible for scatter to create a new figure to draw the points on.
>

Essentially what I want to do is to plot those y1, y2 vars with the same x axes, and then plot some points on each of the y1 and y2 graphs.

I have seen such graphs with Matlab before, but I don't know how to do it.
Can you tell me how to do it?

Thanks,

-ken

Walter Roberson <roberson(a)hushmail.com> wrote in message <hodcqf$8mk$1(a)canopus.cc.umanitoba.ca>...
> Ken wrote:
>
> > Thanks. This doesn't work as scatter do generate another plot with the
> > points.
>
> Please post your comments *below* the material you are commenting on. It
> makes it easier to follow the conversation. Do you prefer that your
> books be printed from the last chapter to the first?
>
> > I want to generate them on the same plot. It has to be on one of the two
> > plots, either on plotyy or line graph... don't have to be on both. I put
> > them both since I didn't get any of them working...
>
> If you use the axis as the first argument, like I did in my sample code,
> it is not possible for scatter to create a new figure to draw the points on.
>
> >> In general, to add points, I would suggest you use
> >> scatter(ax1, pointx, pointy, '*')
> >> scatter(ax(1), pointx, pointy, '*')
>
> > Let me know if you got a solution for it asap...
>
> Even I have to sleep sometime!
First  |  Prev  | 
Pages: 1 2
Prev: mvncdf
Next: How to debug a cell?