Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
plotyy (change marker when plotting more than 2 sets)

Subject: plotyy (change marker when plotting more than 2 sets)

From: Kapila Bandara

Date: 12 Sep, 2013 09:39:21

Message: 1 of 3

x1 = [1:.1:40];
y1 = 4.*(x1)./(x1+2);
x2 = [1:.2:20];
y2 = x2.^2./x2.^4;

y3 = x2.^2./x2.^3;

[haxes,H1,H2]=plotyy(x1,y1,x2,[y2.',y3.'],@loglog)
hold on
set(H1,'linestyle','none','marker','*','markerfacecolor','b','markersize',4)
set(H2,'linestyle','none','marker','o','markerfacecolor','r','markersize',4)

>>>>>>>>>>>>>>>>>>>>>>>>>

I want to display Y3 with another marker (diamond). Could you please help me

Subject: plotyy (change marker when plotting more than 2 sets)

From: dpb

Date: 12 Sep, 2013 13:06:52

Message: 2 of 3

On 9/12/2013 4:39 AM, Kapila Bandara wrote:
> x1 = [1:.1:40];
> y1 = 4.*(x1)./(x1+2);
> x2 = [1:.2:20];
> y2 = x2.^2./x2.^4;
>
> y3 = x2.^2./x2.^3;
>
> [haxes,H1,H2]=plotyy(x1,y1,x2,[y2.',y3.'],@loglog)
> hold on
> set(H1,'linestyle','none','marker','*','markerfacecolor','b','markersize',4)
> set(H2,'linestyle','none','marker','o','markerfacecolor','r','markersize',4)
>
> I want to display Y3 with another marker (diamond).

H2 is array of handles to the RH axis lines -- set properties for them
individually as desired instead of en masse w/ the full array as did...

set(H2(1),'linestyle','none','marker','o',...
set(H2(2),'linestyle','none','marker','x',...

--

Subject: plotyy (change marker when plotting more than 2 sets)

From: Kapila Bandara

Date: 13 Sep, 2013 04:38:05

Message: 3 of 3

On Thursday, September 12, 2013 11:06:52 PM UTC+10, dpb wrote:
> On 9/12/2013 4:39 AM, Kapila Bandara wrote:
>
> > x1 = [1:.1:40];
>
> > y1 = 4.*(x1)./(x1+2);
>
> > x2 = [1:.2:20];
>
> > y2 = x2.^2./x2.^4;
>
> >
>
> > y3 = x2.^2./x2.^3;
>
> >
>
> > [haxes,H1,H2]=plotyy(x1,y1,x2,[y2.',y3.'],@loglog)
>
> > hold on
>
> > set(H1,'linestyle','none','marker','*','markerfacecolor','b','markersize',4)
>
> > set(H2,'linestyle','none','marker','o','markerfacecolor','r','markersize',4)
>
> >
>
> > I want to display Y3 with another marker (diamond).
>
>
>
> H2 is array of handles to the RH axis lines -- set properties for them
>
> individually as desired instead of en masse w/ the full array as did...
>
>
>
> set(H2(1),'linestyle','none','marker','o',...
>
> set(H2(2),'linestyle','none','marker','x',...
>
>
>
> --

Thank you very much. It is working

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us