Got Questions? Get Answers.
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:
change properties of "Plotyy" figure

Subject: change properties of "Plotyy" figure

From: Hermano Cappa

Date: 24 Mar, 2010 13:31:05

Message: 1 of 3

Hi,

I made a "plotyy" figure with the following code:

diameter = [25 37 50 63 75 87 100];

stiffness = [1.2907e8 1.6371e8 1.9098e8 2.1536e8 2.2872e8 2.3626e8 2.3515e8 ;

damping = [1.5509 1.4245 1.3633 1.3193 1.3224 1.3414 1.3879]*1e6;

p = polyfit(diameter,stiffness,15);
stiffness = polyval(p,diameter);
pp = polyfit(diameter,damping,15);
damping = polyval(pp,diameter);

[AX,H1,H2]= plotyy(diameter,stiffness,diameter,damping,'plot');
xlabel('Feedhole diameter [\mum]')

When I want to change the Xlimits or the font of the y-axis, Matlab changes this only for the "stiffness" graph. The properties of the "damping" graph remains the same. How can I solve this

Subject: change properties of "Plotyy" figure

From: Steven Lord

Date: 24 Mar, 2010 13:41:50

Message: 2 of 3


"Hermano Cappa" <cappasteven@gmail.com> wrote in message
news:hod46p$bul$1@fred.mathworks.com...
> Hi,
>
> I made a "plotyy" figure with the following code:
> diameter = [25 37 50 63 75 87 100];
>
> stiffness = [1.2907e8 1.6371e8 1.9098e8 2.1536e8 2.2872e8 2.3626e8
> 2.3515e8 ;
>
> damping = [1.5509 1.4245 1.3633 1.3193 1.3224 1.3414 1.3879]*1e6;
>
> p = polyfit(diameter,stiffness,15);
> stiffness = polyval(p,diameter);
> pp = polyfit(diameter,damping,15);
> damping = polyval(pp,diameter);
>
> [AX,H1,H2]= plotyy(diameter,stiffness,diameter,damping,'plot');
> xlabel('Feedhole diameter [\mum]')
> When I want to change the Xlimits or the font of the y-axis, Matlab
> changes this only for the "stiffness" graph. The properties of the
> "damping" graph remains the same. How can I solve this
>

Change the properties of the vector of axes handles stored as AX.

--
Steve Lord
slord@mathworks.com
comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ

Subject: change properties of "Plotyy" figure

From: Hermano Cappa

Date: 24 Mar, 2010 14:18:06

Message: 3 of 3

"Steven Lord" <slord@mathworks.com> wrote in message <hod4qh$m61$1@fred.mathworks.com>...
>
> "Hermano Cappa" <cappasteven@gmail.com> wrote in message
> news:hod46p$bul$1@fred.mathworks.com...
> > Hi,
> >
> > I made a "plotyy" figure with the following code:
> > diameter = [25 37 50 63 75 87 100];
> >
> > stiffness = [1.2907e8 1.6371e8 1.9098e8 2.1536e8 2.2872e8 2.3626e8
> > 2.3515e8 ;
> >
> > damping = [1.5509 1.4245 1.3633 1.3193 1.3224 1.3414 1.3879]*1e6;
> >
> > p = polyfit(diameter,stiffness,15);
> > stiffness = polyval(p,diameter);
> > pp = polyfit(diameter,damping,15);
> > damping = polyval(pp,diameter);
> >
> > [AX,H1,H2]= plotyy(diameter,stiffness,diameter,damping,'plot');
> > xlabel('Feedhole diameter [\mum]')
> > When I want to change the Xlimits or the font of the y-axis, Matlab
> > changes this only for the "stiffness" graph. The properties of the
> > "damping" graph remains the same. How can I solve this
> >
>
> Change the properties of the vector of axes handles stored as AX.
>
> --
> Steve Lord
> slord@mathworks.com
> comp.soft-sys.matlab (CSSM) FAQ: http://matlabwiki.mathworks.com/MATLAB_FAQ
>

Thank you Steve but I still have two problems I can't solve.

I made a printscreen of my plot: http://people.mech.kuleuven.be/~u0064377/figure/

1. On the x-axis the first two data points (25 and 100), the font is thicker than the other points.

2. If you look to the plot, the thickness of the lines is not constant

How can I solve these two problems?

Tags for 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