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:
Decrease the decimal places in graph

Subject: Decrease the decimal places in graph

From: Idra

Date: 1 Nov, 2012 14:50:08

Message: 1 of 3

I want to decrease the decimal places to 4 decimal places for x and y values. I have this:

clear
figure

x=3.6330;
y1=0.9787;
y2=0.9743;
y3=0.9577;
plot(x,y1,'.-','MarkerSize',15)
hold all
plot(x,y2,'*-','MarkerSize',10)
plot(x,y3,'+-', 'MarkerSize',10)

title('Comparison of power, n=7, outlier=10{\sigma},{\alpha}=0.15')
hleg1 = legend('Lenth', 'Dong', 'Berk & Piacard',2);
set(hleg1,'FontSize',7)
set(hleg1,'FontAngle','italic')
strValues = strtrim(cellstr(num2str([x(:) y1(:)],'(%f,%f)')));
text(x,y1,strValues,'VerticalAlignment','bottom');
strValues = strtrim(cellstr(num2str([x(:) y2(:)],'(%f,%f)')));
text(x,y2,strValues,'VerticalAlignment','bottom');
strValues = strtrim(cellstr(num2str([x(:) y3(:)],'(%f,%f)')));
text(x,y3,strValues,'VerticalAlignment','bottom');
xlabel('Contrasts')
ylabel('Power')

Is there any solutions?Thank you!

Subject: Decrease the decimal places in graph

From: Don Ron

Date: 1 Nov, 2012 16:38:08

Message: 2 of 3

"Idra" wrote in message <k6u270$g0s$1@newscl01ah.mathworks.com>...
> I want to decrease the decimal places to 4 decimal places for x and y values. I have this:
>
> clear
> figure
>
> x=3.6330;
> y1=0.9787;
> y2=0.9743;
> y3=0.9577;
> plot(x,y1,'.-','MarkerSize',15)
> hold all
> plot(x,y2,'*-','MarkerSize',10)
> plot(x,y3,'+-', 'MarkerSize',10)
>
> title('Comparison of power, n=7, outlier=10{\sigma},{\alpha}=0.15')
> hleg1 = legend('Lenth', 'Dong', 'Berk & Piacard',2);
> set(hleg1,'FontSize',7)
> set(hleg1,'FontAngle','italic')
> strValues = strtrim(cellstr(num2str([x(:) y1(:)],'(%f,%f)')));
> text(x,y1,strValues,'VerticalAlignment','bottom');
> strValues = strtrim(cellstr(num2str([x(:) y2(:)],'(%f,%f)')));
> text(x,y2,strValues,'VerticalAlignment','bottom');
> strValues = strtrim(cellstr(num2str([x(:) y3(:)],'(%f,%f)')));
> text(x,y3,strValues,'VerticalAlignment','bottom');
> xlabel('Contrasts')
> ylabel('Power')
>
> Is there any solutions?Thank you!

(%1.4f,%1.4f) instead of (%f,%f)...

don.

Subject: Decrease the decimal places in graph

From: Idra

Date: 16 Nov, 2012 04:28:18

Message: 3 of 3

"Don" wrote in message <k6u8hg$bm0$1@newscl01ah.mathworks.com>...
> "Idra" wrote in message <k6u270$g0s$1@newscl01ah.mathworks.com>...
> > I want to decrease the decimal places to 4 decimal places for x and y values. I have this:
> >
> > clear
> > figure
> >
> > x=3.6330;
> > y1=0.9787;
> > y2=0.9743;
> > y3=0.9577;
> > plot(x,y1,'.-','MarkerSize',15)
> > hold all
> > plot(x,y2,'*-','MarkerSize',10)
> > plot(x,y3,'+-', 'MarkerSize',10)
> >
> > title('Comparison of power, n=7, outlier=10{\sigma},{\alpha}=0.15')
> > hleg1 = legend('Lenth', 'Dong', 'Berk & Piacard',2);
> > set(hleg1,'FontSize',7)
> > set(hleg1,'FontAngle','italic')
> > strValues = strtrim(cellstr(num2str([x(:) y1(:)],'(%f,%f)')));
> > text(x,y1,strValues,'VerticalAlignment','bottom');
> > strValues = strtrim(cellstr(num2str([x(:) y2(:)],'(%f,%f)')));
> > text(x,y2,strValues,'VerticalAlignment','bottom');
> > strValues = strtrim(cellstr(num2str([x(:) y3(:)],'(%f,%f)')));
> > text(x,y3,strValues,'VerticalAlignment','bottom');
> > xlabel('Contrasts')
> > ylabel('Power')
> >
> > Is there any solutions?Thank you!
>
> (%1.4f,%1.4f) instead of (%f,%f)...
>
> don.
Thanks a lot!

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