How do I rescale the x-axis?

조회 수: 6 (최근 30일)
Joshua Finkelstein
Joshua Finkelstein 2018년 5월 1일
댓글: Joshua Finkelstein 2018년 5월 1일
Hi,
I am plotting a certain physical quantity over time [fs]. I would like to rescale the x-axis so that it displays time in units of picoseconds (this will then get rid of the annoying power of 10 that appears on the x-axis). I am unsure how to do this. Can someone offer a suggestion?
Thanks!

채택된 답변

Wick
Wick 2018년 5월 1일
The simplest way is to change the values in your plot command. Divide all your fs times by 1000 and now they're picosecond times.
instead of: plot(time_vector , function_of_time)
try: plot(time_vector/1000, function_of_time)
You can also force limits on your x-axis both with the xlim and axis commands. You can set your minor and major tick marks with the set command or the plottools UI. But start with the above.
  댓글 수: 1
Joshua Finkelstein
Joshua Finkelstein 2018년 5월 1일
Great suggestion, thanks!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by