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

How to change units axes in a plot

Asked by Samuel on 30 Jan 2013

Hello, perhaps a silly question but searching around, I couldn't find anything, so here goes- I have a plot of stress vs strain in Pascals vs m/m. However, I wanted to show the plot in units of MPa vs microstrain(um/um). Is there a straightforward way to change these units during plotting (versus modifying actual data)? I looked through the figure palette and property editor but didn't find anything other than modifying individual data values.

Any help will be appreciated. Thanks in advance. sam

0 Comments

Samuel

Products

1 Answer

Answer by Azzi Abdelmalek on 30 Jan 2013
set(gca,'units','inches')

2 Comments

Samuel on 30 Jan 2013

Thanks for the input. So how would i implement it for just the y axis, for example?

plot(func)
set(gca,'units','mPa')?

how would i set up so that only the y axis is effected?

thanks.

Azzi Abdelmalek on 30 Jan 2013

I don't know what is mPa, but if you want to know what are allowed units type

   set(gca,'units')
Azzi Abdelmalek

Contact us